Go to All Forums

nagios plugin won't show in dashboard

Hello,

I want to use nagios plugin. For sure, it is check_disk plugin. My OS is centos7, python 2.7.5, monagent 16.7.6

www.nagios.org/downloads/nagios-plugins/

I already read this article about plugin support. 

www.site24x7.com/plugins/nagios-monitoring.html

I was able to add plugin to monitoring on agent side. There is a report from plugin in  /opt/site24x7/monagent/logs/details/plugins.txt, which is fine, but i didnt found any new board in the dashboard. 

---
2018-01-18 21:57:24,335 Worker 1, plugin - check_disk_space | output - {"exit_code": 0, "result": true, "output": "OK; /: total 77.1GB, used 1.5GB (2.0%), free 75.6GB (98.0%) | 'used space'=1637978112B;82792865792;82792865792;0;82792865792 'used space (pct.)'=2.0%;100;100;0;100"}

---

Plugin is runinng more then 2 days.

I want to have board with report or at least some possibility to set up threshold and notification/alert for values specified in plugin configuration.

 

Thank you.

Like (1) Reply
Replies (5)

Re: nagios plugin won't show in dashboard

Hi Marek,

script output : OK; /: total 77.1GB, used 1.5GB (2.0%), free 75.6GB (98.0%) | 'used space'=1637978112B;82792865792;82792865792;0;82792865792 'used space (pct.)'=2.0%;100;100;0;100

We see there is a white space in the metric 'used space' and 'used space (pct.)'. This causes an exception while parsing the nagios data thus resulting in plugin not getting added.

Any value which occurs to the right of '|' is treated as performance data of the nagios script.

If the script provide more than one performance metric it is separated by white space. so white space should not be used any where in the performance data other than the separator.

In the above command since the metric key itself has a white space it results in the error. Generally nagios scripts does not use white space in the metric name. This script seems to be an exception.

Have made some changes in the script to provide a proper naming convention.

Now the output looks like

script output : OK; /: total 77.1GB, used 1.5GB (2.0%), free 75.6GB (98.0%) | used_space=1637978112B;82792865792;82792865792;0;82792865792 used_space_percentage=2.0%;100;100;0;100

Steps to be followed :

Kindly download the attachment and place the script in the server.

remove the file /opt/site24x7/monagent/temp/ignored_plugins.txt

Wait for next polling ( maximum of five minutes ) and see whether the plugin is working.

We request you to update the status after performing the above steps.

 

- Sriram

Attachments
check_disk_space.zip
Size: 2.19 KB
Like (1) Reply

Re: Re: nagios plugin won't show in dashboard

Hi Siriam

thanks you for help.

Your solution is working.

One more important question, can i configure threshold for a plugin? 

 M

Like (0) Reply

Re: Re: Re: nagios plugin won't show in dashboard

Hi Marek,

Glad the solution worked.

Yes you can configure threshold for a plugin and get alerted.

To configure threshold for a plugin kindly follow the steps provided in the link :

https://www.site24x7.com/help/admin/configuration-profiles/threshold-and-availability/plugin-monitor.html

 

Sriram

Like (0) Reply

Re: Re: Re: Re: nagios plugin won't show in dashboard

Hello Siriam,

thank you for help. 

one more thing, i edited nagios script, cause i need setup threshold for two points exmp. 70% and 80% disk usage. Easily i need to set up more attributes for one plugin.

output from log:


Plugin Data for Save : {"version": 1, "ct": 1516697664027, "data": {"crit_percentage": "1.4", "used_space": "1171050496", "warn_percentage": "1.4", "check_disk_space_status": "0.00"}, "availability": 1}


so it is look pretty good, but problem is that new column (used_percentage) won't show in webui.

I am not able to find why. I restarted monagetn and i reregistered plugin also and i was waiting much more than five minutes.

Can you please help me or give me some useful link where can i find how to solve the problem?

 

Thank you. 

Marek

 

Like (0) Reply

Re: Re: Re: Re: Re: nagios plugin won't show in dashboard

ok i got it, after times of monagent restarts a plugins re-registrating, it is finally working..

Like (0) Reply

Was this post helpful?