Page 1 of 1

[Nagios-devel] issue with LASTSTATECHANGE macro

Posted: Wed Nov 19, 2008 1:52 pm
by Guest
This is a multi-part message in MIME format.
--------------070807070005090208010005
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

I'm using nagios 1.2 and did not find anything in the change log for
1.x, 2.x or 3.x indicating any fixes for this macro.
The problem I'm having is that I have an event handler that is being
passed this macro and the TIMET macro.
The event handler is defined as:

define command{
command_name psynch_maint
command_line /usr/local/nagios/libexec/eventhandlers/psynch_maint
$HOSTNAME$ $SERVICEDESC$ $SERVICESTATE$ $HOSTSTATE$ "$DATETIME$"
$STATETYPE$ $SERVICEATTEMPT$ $LASTSTATECHANGE$ $TIMET$ '$OUTPUT$'
}

Every time this handler fires it records the values of each of the
command-line arguments into a log file.
The issue appears that the value of $LASTSTATECHANGE$ is always the same
as the $TIMET$ macro.

Wed Nov 19 02:44:22 CST 2008: HOSTNAME=psync-cluster SERVICEDESC=PSYNC
SERVICESTATE=CRITICAL HOSTSTATE=UP DATETIME="Wed Nov 19 02:44:22 CST
2008" STATETYPE=SOFT SERVICEATTEMPT=1 LASTSTATECHANGE=1227084262
TIMET=1227084262 OUTPUT=Service cluster problem: 0 ok, 0 warning, 0
unknown, 2 critical

===================================
Wed Nov 19 02:46:22 CST 2008: HOSTNAME=psync-cluster SERVICEDESC=PSYNC
SERVICESTATE=CRITICAL HOSTSTATE=UP DATETIME="Wed Nov 19 02:46:22 CST
2008" STATETYPE=HARD SERVICEATTEMPT=2 LASTSTATECHANGE=1227084382
TIMET=1227084382 OUTPUT=Service cluster problem: 0 ok, 0 warning, 0
unknown, 2 critical

===================================
Wed Nov 19 04:31:21 CST 2008: HOSTNAME=psync-cluster SERVICEDESC=PSYNC
SERVICESTATE=OK HOSTSTATE=UP DATETIME="Wed Nov 19 04:31:21 CST 2008"
STATETYPE=HARD SERVICEATTEMPT=2 LASTSTATECHANGE=1227090681
TIMET=1227090681 OUTPUT=Service cluster ok: 2 ok, 0 warning, 0 unknown,
0 critical

Bob



--------------070807070005090208010005
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit






I'm using nagios 1.2 and did not find
anything in the change log for 1.x, 2.x or 3.x indicating any fixes for
this macro.
The problem I'm having is that I have an event handler that is being
passed this macro and the TIMET macro.
The event handler is defined as:

define command{
    command_name    psynch_maint
    command_line /usr/local/nagios/libexec/eventhandlers/psynch_maint
$HOSTNAME$ $SERVICEDESC$ $SERVICESTATE$ $HOSTSTATE$ "$DATETIME$"
$STATETYPE$ $SERVICEATTEMPT$ $LASTSTATECHANGE$ $TIMET$ '$OUTPUT$'
    }

Every time this handler fires it records the values of each of the
command-line arguments into a log file.
The issue appears that the value of $LASTSTATECHANGE$ is always the
same as the $TIMET$ macro.

Wed Nov 19 02:44:22 CST 2008: HOSTNAME=psync-cluster SERVICEDESC=PSYNC
SERVICESTATE=CRITICAL HOSTSTATE=UP DATETIME="Wed Nov 19 02:44:22 CST
2008" STATETYPE=SOFT SERVICEATTEMPT=1 LASTSTATECHANGE=1227084262
TIMET=1227084262 OUTPUT=Service cluster problem: 0 ok, 0 warning, 0
unknown, 2 critical

===================================
Wed Nov 19 02:46:22 CST 2008: HOSTNAME=psync-cluster SERVICEDESC=PSYNC
SERVICESTATE=CRITICAL HOSTSTATE=UP DATETIME="Wed Nov 19 02:46:22 CST
2008" STATETYPE=HARD SERVICEATTEMPT=2 LASTSTATECHANGE=1227084382
TIMET=1227084382 OUTPUT=Service cluster problem: 0 ok, 0 warning, 0
unknown, 2 critical

===================================
Wed Nov 19 04:31:21 CST 2008: HOSTNAME=psync-cluster SERVICEDESC=PSYNC
SERVICESTATE=OK HOSTSTATE=UP DATETIME="Wed Nov 19 04:31:21 CST 2008"
STATETYPE=HARD SERVICEATTEMPT=2 LASTSTATECHANGE=1227090681
TIMET=1227090681 OUTPUT=Service cluster ok: 2 ok, 0 warning, 0 unknown,
0 critical

Bob






--------------070807070005090208010005--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]