Good afternoon, comrades! I need to programmatically compare the load on the servers in nagios and issue the most unloaded server (its ip) to some file, can this be done by a plugin or by some script? I just can not figure out where to pull the information from the nagios at the moment.

    1 answer 1

    nagios displays the current monitoring status in the status.dat file. It is textual, located with Linux in the / var / log / nagios directory

    • Strange, I don't have such a file, in / var / log / nagios3 I have the archives folder and the file nagios.log - Lane
    • maybe in your distribution kit lies elsewhere. File should be. Version, apparently, the third, like me. Search elsewhere. The configuration indicates the location in the status_file parameter - maint
    • Thank you so much, it remains to learn how to pull data from it! I went to nagios.cfg and saw: status_file = / var / cache / nagios3 / status.dat - Lane
    • servicestatus, there and all the state of services on the hosts. The format is something like json. eg servicestatus {host_name = localhost service_description = Swap Usage plugin_output = SWAP OK - 100% free (31999 MB out of 31999 MB)} - maint
    • Thanks, once again, found a script that can parse this file in json! Link: github.com/lizell/php-nagios-json , yes, I figured out, there everything you need is there and CPU and RAM load and hard disk usage - Lane