How to display more content in status column?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
xpertech
Posts: 399
Joined: Thu Sep 01, 2011 9:47 pm

How to display more content in status column?

Post 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?
You do not have the required permissions to view the files attached to this post.
xpertech
Posts: 399
Joined: Thu Sep 01, 2011 9:47 pm

Re: How to display more content in status column?

Post by xpertech »

Here is the plugin we use.
You do not have the required permissions to view the files attached to this post.
bolson

Re: How to display more content in status column?

Post 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.
xpertech
Posts: 399
Joined: Thu Sep 01, 2011 9:47 pm

Re: How to display more content in status column?

Post by xpertech »

Is it possible to display more information in the "Status Information" field which like the command has got?
bolson

Re: How to display more content in status column?

Post 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
xpertech
Posts: 399
Joined: Thu Sep 01, 2011 9:47 pm

Re: How to display more content in status column?

Post by xpertech »

I wonder why the command will return "value"=1 after the pipe, but the GUI didn't?
bolson

Re: How to display more content in status column?

Post 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.
xpertech
Posts: 399
Joined: Thu Sep 01, 2011 9:47 pm

Re: How to display more content in status column?

Post 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?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: How to display more content in status column?

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked