Page 1 of 1
How to display more content in status column?
Posted: Wed Dec 19, 2018 5:27 am
by xpertech
When using command, the status will not only display OK but also display more contents(eg. value=1), but the GUI status only display OK.
how to make the GUI status field to display more contents?
Re: How to display more content in status column?
Posted: Wed Dec 19, 2018 5:44 am
by xpertech
Here is the plugin we use.
Re: How to display more content in status column?
Posted: Wed Dec 19, 2018 2:43 pm
by bolson
Hello xpertech,
Nagios plugins return an integer exit code of 0, 1, 2, or 3 which represent a status of Ok, Warning, Critical, or Unknown, respectively. As such, it's not possible to display anything beyond those values as what you see in the web gui is simply an interpretation of the exit code. Let us know if this is sufficiently clear and if we may close the thread as resolved.
Thank you for visiting the Nagios Support Forum.
Re: How to display more content in status column?
Posted: Wed Dec 19, 2018 6:24 pm
by xpertech
Is it possible to display more information in the "Status Information" field which like the command has got?
Re: How to display more content in status column?
Posted: Thu Dec 20, 2018 10:22 am
by bolson
Hello xpertech,
The specification for what is returned by a Nagios plugin is as follows:
The plugin returns an exit code (0, 1, 2, or 3) followed by a line of text. The line of text is actually two elements of data, separated by a pipe character "|". The text before the pipe is the Status Information, and the text after the pipe is the performance graphing data. As you see, the plugin doesn't return any text before the pipe which is why the Status Information field is blank. The only way this particular plugin could return Status Information would be to modify the plugin to return text before the pipe character. I've attached a link to the author's GitHub page. Hope this helps.
https://github.com/drewkerrigan/nagios- ... tp_json.py
Re: How to display more content in status column?
Posted: Thu Dec 20, 2018 12:38 pm
by xpertech
I wonder why the command will return "value"=1 after the pipe, but the GUI didn't?
Re: How to display more content in status column?
Posted: Thu Dec 20, 2018 1:50 pm
by bolson
Hello xpertech,
Perhaps I could have been more clear. The following command for a memory check will illustrate the point:
Code: Select all
[root@localhost libexec]# ./check_win -H 192.168.5.238 -t mytoken -m memory -w 80 -c 90
Warning: Physical Memory Total: 16248MB, - Used: 13694MB, (84%) - Free: 2554MB|'Physical Memory Used'=13694MB: 'Physical Memory Utilization'=84%;80;90;
In this example, the text before the pipe will show up in the status detail field, and the text after the pipe will show up as the legend and data points in a performance graph. The problem with the plugin you are running is that the status detail field (text before the pipe) is empty. Therefore, the status detail in the web gui will also be empty. This is by design.
Re: How to display more content in status column?
Posted: Fri Dec 28, 2018 6:34 pm
by xpertech
We tried to edit the plugin and then it finally can display information that we want, but there's no performance graph data? is that the plugin didn't cover performance graph data? how to write performance graph feature in a plugin, is there a document about that which we could reference?
Re: How to display more content in status column?
Posted: Wed Jan 02, 2019 10:33 am
by lmiltchev
You can click on the service under the "Service Status" page, then go to the "Advanced" tab, and see if the check returns perfdata AND if the perfdata is formatted properly. Read more on how the perfdata need to be formatted here:
https://nagios-plugins.org/doc/guidelines.html#AEN200
You may also need to remove the old RRD and XML files for this service, after you modified your check, so that perfdata will start showing up. You can find the files in "/usr/local/nagios/share/perfdata/<hostname>/" directory. Hope this helps.