Right back in the office, have copied what we learned from the home system to the work one, and no luck. Here's what i now know;
Code: Select all
root@nagios:/usr/local/nagios/libexec/eventhandlers# tail /usr/local/nagios/var/nagios.log
[1453464305] EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;IT;1453464304
[1453464309] HOST ALERT: IT;UP;HARD;10;PING OK - Packet loss = 0%, RTA = 0.89 ms
[1453464328] SERVICE ALERT: IT;Toner Supply;OK;HARD;3;TK-3100 is at 6% - OK! Waste Toner Box is OK!
[1453464328] SERVICE FLAPPING ALERT: IT;Toner Supply;STARTED; Service appears to have started flapping (23.8% change >= 20.0% threshold)
[1453464328] SERVICE EVENT HANDLER: IT;Toner Supply;OK;HARD;3;otrs-event-ok
[1453464395] HOST ALERT: TS7-V;DOWN;SOFT;1;PING CRITICAL - Packet loss = 100%
[1453464400] HOST ALERT: TS7-V;UP;SOFT;2;PING OK - Packet loss = 0%, RTA = 24.56 ms
[1453464934] SERVICE ALERT: IT;Toner Supply;WARNING;SOFT;1;WARNING: No SNMP response from 192.168.1.199! Make sure host is up and SNMP is configured properly.
[1453464934] SERVICE EVENT HANDLER: IT;Toner Supply;WARNING;SOFT;1;otrs-event-ok
[1453464943] HOST ALERT: IT;DOWN;SOFT;1;PING CRITICAL - Packet loss = 100%
root@nagios:/usr/local/nagios/libexec/eventhandlers#
You can see the event is being handled now, I modified the sh as follows;
Code: Select all
#!/bin/bash
# ---
# $Id: host_otrs_event_ok.sh 6 2008-09-08 14:13:52Z wob $
# ---
if [ -z "$WEBSERVER" ]; then
WEBSERVER=`hostname -f`
fi
if [ -z "$OTRS_EMAIL" ]; then
[email protected]
fi
LOGFILE=/var/nagios/otrs.log
DATUM=`date "+%Y-%m-%d_%H:%M:%S"`
echo "$DATUM EVENTHANDLER $NAGIOS_HOSTNAME: State $NAGIOS_HOSTSTATE/$NAGIOS_HOSTSTATETYPE/$NAGIOS_HOSTATTEMPT" >> $$
case "$NAGIOS_HOSTSTATE" in
OK)
I tested my email into OTRS and it works from OUTLOOK. Also that script says it keeps a log in var/ but when i check;
root@nagios:/usr/local/nagios/var# ls
archives nagios.lock nagios.tmpylkeD6 objects.precache rw status.dat
nagios.configtest nagios.log objects.cache retention.dat spool
root@nagios:/usr/local/nagios/var#
Any more ideas?