Box293 wrote:Can you show us the command definition you've defined to use as the event handler.
Can you also show us the command being executed in an SSH session on your Nagios server (along with the output). This will help us understand what a "working" example of this plugin is.
Hi,
Code: Select all
define command {
command_name host-otrs-event-ok
command_line $USER1$/eventhandlers/host_otrs_event_ok.sh
}
define command {
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTAT$
}
define command {
command_name notify-otrs
command_line $USER1$/eventhandlers/notify_otrs.sh
}
define command {
command_name otrs-event-ok
command_line $USER1$/eventhandlers/otrs_event_ok.sh#
}
These are the commands that've put into the commands.cfg from the gui.
Whenever i run any of the commands from the command line, i just get;
Code: Select all
[root@localhost libexec]# ./notify_otrs.sh
./notify_otrs.sh: line 12: /var/nagios/otrs.log: No such file or directory
[root@localhost libexec]# ./otrs_event_ok.sh
./otrs_event_ok.sh: line 16: /var/nagios/otrs.log: No such file or directory
[root@localhost libexec]#
So looking into the var directory I can see that log and folder doesn't exist
Code: Select all
[root@localhost libexec]# cd /var/
[root@localhost var]# ls
cache db empty games lib local lock log mail nis opt preserve run spool tmp www yp
[root@localhost var]#
So there must be a process somewhere that creates this folder, can you help me troubleshoot whats going on?
OTRS is on Centos7 and Nagios is the same, they run on seperate VM's but both on the same machine (this is just for testing and learning, so not worried about performance)
Thanks again