Explorar el Código

check_nagios - could not locate a running nagios process

Fix for issue https://github.com/nagios-plugins/nagios-plugins/issues/94

proc_cgroup_hierarchy was defined as a 'char*' but never allocated, so
'sscanf' quit at that point, never getting the command.
John C. Frickson hace 9 años
padre
commit
cd0d850963
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      plugins/check_nagios.c

+ 1 - 1
plugins/check_nagios.c

@@ -66,7 +66,7 @@ main (int argc, char **argv)
 	int procppid = 0;
 	int procvsz = 0;
 	int procrss = 0;
-	char *proc_cgroup_hierarchy;
+	char proc_cgroup_hierarchy[MAX_INPUT_BUFFER];
 	float procpcpu = 0;
 	char procstat[8];
 #ifdef PS_USES_PROCETIME