then
run setcap cap_dac_read_search,cap_sys_ptrace+ep "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin"
setcap_ret=$?
+
+ if [ ${setcap_ret} -eq 0 ]
+ then
+ # if we managed to setcap
+ # but we fail to execute apps.plugin
+ # trigger setuid to root
+ "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin" -v >/dev/null 2>&1
+ setcap_ret=$?
+ fi
fi
if [ ${setcap_ret} -ne 0 ]
}
}
+ if(strcmp("version", argv[i]) == 0 || strcmp("-v", argv[i]) == 0) {
+ printf("apps.plugin %s\n", VERSION);
+ exit(0);
+ }
+
if(strcmp("debug", argv[i]) == 0) {
debug = 1;
// debug_flags = 0xffffffff;
if(strcmp("-h", argv[i]) == 0 || strcmp("--help", argv[i]) == 0) {
fprintf(stderr,
- "apps.plugin\n"
+ "apps.plugin %s\n"
"(C) 2016 Costa Tsaousis"
"GPL v3+\n"
"This program is a data collector plugin for netdata.\n"
"NAME read apps_NAME.conf instead of\n"
" apps_groups.conf\n"
" (default NAME=groups)\n"
+ "\n"
+ "version print program version and exit\n"
+ "\n"
+ , VERSION
);
exit(1);
}