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:
slerena 2009-10-15 20:47:49 +00:00
parent 472af37ca9
commit 017f3305aa
3 changed files with 24 additions and 2 deletions

View File

@ -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

View File

@ -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);

View File

@ -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
)
@ -99,6 +103,11 @@ case "$1" in
COUNTER=`expr $COUNTER + 1`
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