Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
A Nagios script can only have one print statement... everything except the last print statement will be ignored. In order to do multi-line output you need to separate the lines using the newline seperator. Nagios will also only display the first line of multi-line output unless you click on the service to get the full detailed information.
The colour displayed (aka state) in Nagios isn't determined by the words OK, Critical, etc in the description text... The state is determined by the exit code of the script.
OK: exit 0
Warning: exit 1
Critical: exit 2
Unknown: exit 3
Thanks JSmurphy, I was able to display colors correctly by using exit codes. But not got any clue for multi line output. In document also its saying, out of luck if returns more than one line.
Please guide me if any other way for multi line output.
The only way to get multi line output in the web interface is to open the Service's details page, the overview of all services will not display multiple lines.
Whatever service has the multiple lines of output that you want to view. Most pages in the Nagios interface will only display one line of plugin output. If a service returns more than one line, you must go to its Service Detail page to view the rest.
In order to do multi-line output you need to separate the lines using the newline seperator. Nagios will also only display the first line of multi-line output unless you click on the service to get the full detailed information.