I have a script located on remote server and this script needed to run on remote hosts and get output in director how can i do it in director? Earlier i used to with icingaweb2, and that was easy but with director not able to find option.Any suggestions ?
Is the script running on a Linux or Windows host?
Does the script produce exitcodes and messages on stdout, that are nagios/icinga compatible?
How does the script get started? Would it be possible for icinga to run the script periodically?
Does the script produce a log file that could be monitored?
remote host has NRPE installed . I want to run checks from Icinga server itself. But the script has to be placed on remote host. whats the best way to do it
I have a script running on remote host (Linux server) and i wanted this to be monitored from nagios server.I have updated the configuration file of NRPE
Code:
command[check_disk_uses]=/usr/lib/nagios/plugins/check_disk_uses.sh /dev/sda1
I have also added new file check_disk.cfg on nagios server with define command
I would also prefer with check_by_ssh we are here using icinga2. and i have setup keys there and copied to remote host. when i also do ssh from director., i can connect to remote host with out any issues.but when i check on command line
~# ‘/usr/lib/nagios/plugins/check_by_ssh’ ‘-C’ ‘/usr/lib/nagios/plugins/check_script.sh’ ‘-H’ ‘hostaddress’ -t 30
Remote command execution failed: Unauthorized access to this machine is prohibited
Does ~# mean, that you are issuing the command as root user?
Try with sudo -su icinga or nagios depending on your distribution. If unsure, you can check in /etc/passwd wich of the two exists on your system.
You can connect to root on the remote host but for most checks it’s not needed and least required privileges are best security practices.
Did you get the public key transfered to icinga@remoteserver? If yes, I guess it gets ignored because of wrong rights of /home/icinga/.ssh/ on the remote server.
Cant we add icinga server pubkey to the hosts authorized keys ( /root/.ssh/authorized_keys) on remote server,rather than creating icinga user on remote server ?
when i just some ‘date’ command to run on the remote host by passing -E argument it works
can you pelase tell how to set command endpoint null
usr/lib/nagios/plugins/check_by_ssh -C date -i /home/icinga/.ssh/id_rsa -H host -l icinga -E → works
only my script doesnot work
/usr/lib/nagios/plugins/check_by_ssh -C /usr/lib/nagions/plugins/check_script.sh -i /home/icinga/.ssh/id_rsa -H host -l icinga -E