I have a php script can read status.dat file and return data at json format in data.json file.
So how can I make nagios core execute a php script in background like the plugins?
Make nagios execute script
Re: Make nagios execute script
You can define a command in the commands.cfg or in CCM if using nagios XI. Since nagios expects some text output and a return value between 0-3 your script needs to be set to do so. Then you can create a serive in nagios to execute the script periodically.
Re: Make nagios execute script
- If I do the script like a plugin then I need to add it to one of the hosts, so nagios can execute the script. But I don't want the user to see the service, I just want it to be executed in the background!!.
Re: Make nagios execute script
Why not use something like cron?
https://opensource.com/article/17/11/how-use-cron-linux
Nagios Core is for monitoring. If you just want to periodically run a script or command, cron is a much more lightweight and ubiquitous option for that particular use case IMO.
https://opensource.com/article/17/11/how-use-cron-linux
Nagios Core is for monitoring. If you just want to periodically run a script or command, cron is a much more lightweight and ubiquitous option for that particular use case IMO.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/