Hi,
tody, I have tried to understand what happens in my test case. It seems,
that after a 'monit reload' the
transion from STATE_INIT to STATE_PASSED is not correct handeled. For me
is is a problem in event.c:
What is the reason for this? I found no site effect.
Claus
/**
* Return the actual event state based on event state bitmap
* and event ratio needed to trigger the state change
* @param E An event object
* @param S Actual posted state
* @return The Event raw state
*/
short Event_check_state(Event_T E, short S) {
int i;
int count = 0;
Action_T action;
long long flag;
ASSERT(E);
/* tbd: always state change after initial state! ck */
if(E->state == STATE_INIT)
{
return TRUE; // with this, it works; but why is there the next
statement?
}
/* Only the true failed state condition can change the initial state */
if(S == STATE_PASSED && E->state == STATE_INIT)
{
return FALSE;
}
action = (S == STATE_PASSED)?E->action->passed:E->action->failed;
/* Compare as many bits as cycles able to trigger the action */
for(i = 0; i < action->cycles; i++)
{
/* Check the state of the particular cycle given by the bit position */
flag = (E->state_map >> i) & 0x1;
/* Count occurences of the posted state */
if(flag == S)
{
count++;
}
}
if(count >= action->count && S != E->state)
{
return TRUE;
}
return FALSE;
}
Claus Klein schrieb:
my current disk usage is:
address@hidden:/usr/src/linux/Documentation/serial# df
Dateisystem 1K-Blöcke Benutzt Verfügbar Ben% Eingehängt auf
/dev/hda5 5245016 4825732 419284 93% /
tmpfs 253284 12 253272 1% /dev/shm
with the following monit configuration:
check device rootfilesystem with path /dev/hda5
mode passive
if space usage > 90% then alert
address@hidden:/usr/src/linux/Documentation/serial# monit summary
The monit daemon 4.8.1 uptime: 0m
System 'localhost' Monit instance changed
Process 'snmptrapd' running
Process 'nagios2' running
Directory 'nagios2-command_file' Permission failed
Device 'rootfilesystem' Resource limit matched
Process 'nsca' running
Process 'apache2' running
Process 'ntpd' running
Process 'sshd' running
Process 'dbus' running
Process 'avahi-daemon' running
Process 'avahi-dnsconfd' not monitored
Process 'privoxy' running
address@hidden:/usr/src/linux/Documentation/serial# vi /etc/monit/monitrc
# changed to:
check device rootfilesystem with path /dev/hda5
mode passive
if space usage > 95% then alert
address@hidden:/usr/src/linux/Documentation/serial# monit reload
Reinitializing monit daemon
address@hidden:/usr/src/linux/Documentation/serial# monit summary
The monit daemon 4.8.1 uptime: 0m
System 'localhost' Monit instance changed
Process 'snmptrapd' running
Process 'nagios2' running
Directory 'nagios2-command_file' Permission failed
Device 'rootfilesystem' Resource limit matched
Process 'nsca' running
Process 'apache2' running
Process 'ntpd' running
Process 'sshd' running
Process 'dbus' running
Process 'avahi-daemon' running
Process 'avahi-dnsconfd' not monitored
Process 'privoxy' running
address@hidden:/usr/src/linux/Documentation/serial# monit validate
# Note: no error
# but now there is still an 'Resource limit matched':
address@hidden:/usr/src/linux/Documentation/serial# monit summary
The monit daemon 4.8.1 uptime: 0m
System 'localhost' Monit instance changed
Process 'snmptrapd' running
Process 'nagios2' running
Directory 'nagios2-command_file' Permission failed
Device 'rootfilesystem' Resource limit matched
Process 'nsca' running
Process 'apache2' running
Process 'ntpd' running
Process 'sshd' running
Process 'dbus' running
Process 'avahi-daemon' running
Process 'avahi-dnsconfd' not monitored
Process 'privoxy' running
address@hidden:/usr/src/linux/Documentation/serial#
address@hidden:/usr/src/linux/Documentation/serial# monit status | less
# Note: the timestamp is not updated too!
Device 'rootfilesystem'
status Resource limit matched
monitoring status monitored
permission 660
uid 0
gid 6
block size 4096 B
blocks total 1311254 [5122.1 MB]
blocks free for non superuser 104933 [409.9 MB] [8.0%]
blocks free total 104933 [409.9 MB] [8.0%]
data collected Thu Jun 14 12:38:27 2007
address@hidden:/usr/src/linux/Documentation/serial# monit status | less
...
Device 'rootfilesystem'
status Resource limit matched
monitoring status monitored
permission 660
uid 0
gid 6
block size 4096 B
blocks total 1311254 [5122.1 MB]
blocks free for non superuser 104911 [409.8 MB] [8.0%]
blocks free total 104911 [409.8 MB] [8.0%]
data collected Thu Jun 14 12:41:31 2007
address@hidden:/usr/src/linux/Documentation/serial# date
Do 14. Jun 12:42:35 CEST 2007
----------------------------------
The same happens for directory status after 'Permission failed' if I
fix the permission and run monit validate again!
I tested this again with the current monit release version 4.9,
but same result occured.
claus
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general