I'm encountering an issue using event_handler to run a script (the script juste start a scheduled task on a windows server, that initiates a shutdown of all virtual machines in my infrastructure using powercli). When i'm starting the script manually, everything is going fine.
i'm running nagiosxi on linux centos
i've followed the following procedure
1) i've created a (type: misc) command in nagiosxi (Configure > Core Config Manager > Commands)
2) i've created a host in nagiosxi (for SNMP monitoring of a powersupply)
3) on my linux, i've :
cd /usr/local/nagios/libexec
touch event_handler_shutdown.sh
chmod +x event_handler_shutdown.sh
vi event_handler_shutdown.sh
content of the script : sshpass -p 'MyPassword123' ssh -tt -l [email protected] 10.0.0.1 "schtasks /Run /TN Shutdown_ALL_VM"
4) i'm submitting a passive check result
home > host detail > event_handler_shutdown > advanced > submit passive check result
5) the host simulates a down-time but nothing happens
Probably something wrong on my linux. permissions ?
but i've already modified the sudoers file with
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
nagios ALL=(ALL) ALL
NAGIOSXI ALL=(ALL) ALL
i've also checked my settings with documentation : https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Anyone any idea why this doesn't work ?
the global idea is when powerloss is detected (i've a servercheck where i can check my snmp traps) all vm's of my vcenter needs to shutdown in a specific order. When i execute my script manually from my centos linux everything is working fine. but when it's called throug the event_handler it's just doing nothing !
a simple a echo to a text file works
thanks in advance for your help & time
Bruno