2009-10-16 Sancho Lerena <slerena@artica.es>
* lib/PandoraFMS/Core.pm: Keepalive was not working properly. Keepalive moduletype is now managed like a proc (0 = BAD) in get_status function. * util/pandora_server: Start/Stop daemon now works and problem has been fixed, and I'm very happy after so many days trying to figure what the hell was happening here :-) git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2025 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
472af37ca9
commit
017f3305aa
|
@ -1,3 +1,12 @@
|
|||
2009-10-16 Sancho Lerena <slerena@artica.es>
|
||||
|
||||
* lib/PandoraFMS/Core.pm: Keepalive was not working properly. Keepalive
|
||||
moduletype is now managed like a proc (0 = BAD) in get_status function.
|
||||
|
||||
* util/pandora_server: Start/Stop daemon now works and problem has been
|
||||
fixed, and I'm very happy after so many days trying to figure what the
|
||||
hell was happening here.
|
||||
|
||||
2009-10-15 Sancho lerena <slernea@artica.es>
|
||||
|
||||
* lib/PandoraFMS/SNMPServer.pm: Fixed small problem in snmp2agent
|
||||
|
|
|
@ -836,7 +836,7 @@ sub pandora_module_keep_alive_nd {
|
|||
AND ( tagente_estado.utimestamp + (tagente.intervalo * 2) < UNIX_TIMESTAMP())');
|
||||
|
||||
foreach my $module (@modules) {
|
||||
pandora_process_module ($pa_config, 1, '', $module, 'keep_alive', '', time (), 0, $dbh);
|
||||
pandora_process_module ($pa_config, 0, '', $module, 'keep_alive', '', time (), 0, $dbh);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1080,6 +1080,10 @@ sub get_module_status ($$) {
|
|||
($critical_min, $critical_max) = (0, 1);
|
||||
}
|
||||
|
||||
if ($module_type =~ m/keep_alive/ && ($critical_min eq $critical_max)) {
|
||||
($critical_min, $critical_max) = (0, 1);
|
||||
}
|
||||
|
||||
# Critical
|
||||
if ($critical_min ne $critical_max) {
|
||||
return 1 if ($data >= $critical_min && $data < $critical_max);
|
||||
|
|
|
@ -39,7 +39,11 @@ fi
|
|||
# This function replace pidof, not working in the same way in different linux distros
|
||||
|
||||
function pidof_pandora () (
|
||||
PANDORA_PID=`ps -Af | grep "$PANDORA_DAEMON" | grep -v grep | tail -1 | awk '{ print $2 }'`
|
||||
# This sets COLUMNS to 200 chars, because if command is run
|
||||
# in a "strech" term, ps aux don't report more than COLUMNS
|
||||
# characters and this will not work.
|
||||
COLUMNS=200
|
||||
PANDORA_PID=`ps aux | grep "$PANDORA_DAEMON" | grep -v grep | tail -1 | awk '{ print $2 }'`
|
||||
echo $PANDORA_PID
|
||||
)
|
||||
|
||||
|
@ -100,6 +104,11 @@ case "$1" in
|
|||
sleep 1
|
||||
done
|
||||
|
||||
# Send a KILL -9 signal to process, if it's alive after 60secs, we need
|
||||
# to be sure is really dead, and not pretending...
|
||||
|
||||
kill -9 $PANDORA_PID > /dev/null 2>&1
|
||||
|
||||
rc_status -v
|
||||
fi
|
||||
;;
|
||||
|
|
Loading…
Reference in New Issue