z

Commercial Support Clients: Clients with support contracts can get escalated support assistance by visiting Nagios Answer Hub. These forums are for community support services. Although we at Nagios try our best to help out on the forums here, we always give priority support to our support clients.

Proper ways to create check command

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.

Proper ways to create check command

Postby dhlao » Thu Dec 23, 2021 6:12 am

I've made several check commands that are written in C, they can successfully pass the value (I think they're strings) and are properly shown in Nagios web console.
However, when using Histou to pass value to Grafana for creating graph, they failed.

This doesn't happen when using built-in check_command such as "check_snmp" and "check_ping". So, I wonder what are missing in my code.
dhlao
 
Posts: 14
Joined: Thu Apr 29, 2021 10:23 am

Re: Proper ways to create check command

Postby mcapra » Thu Dec 23, 2021 6:28 am

Probably missing correctly formatted performance data:
https://nagios-plugins.org/doc/guidelines.html#AEN200
Former Nagios employee
https://www.mcapra.com/
User avatar
mcapra
 
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Proper ways to create check command

Postby dhlao » Mon Jan 03, 2022 5:08 am

Hello mcapra,
I haven't added performance data before. After some research, I still get confuse of how to properly include this in the code.

I've checked https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/perfdata.html. Adding the *stroke* doesn't work.

I've tried using the method in https://github.com/nagios-plugins/nagios-plugins/blob/master/plugins/check_ping.c. Line 174-181; function of "perfdata" can't be used even I've included almost all header (.h) files.

I've also visited https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/pluginapi.html. However, I'm still don't have any idea.
dhlao
 
Posts: 14
Joined: Thu Apr 29, 2021 10:23 am

Re: Proper ways to create check command

Postby dhlao » Mon Jan 03, 2022 9:19 pm

Finally, I managed to make performance data works; By referencing a custom check command - "check_eth" which is written in Perl and is available in Nagios Exchange. Thanks to mcapra again for giving me the very useful hint.
dhlao
 
Posts: 14
Joined: Thu Apr 29, 2021 10:23 am


Return to Open Source Nagios Projects

Who is online

Users browsing this forum: No registered users and 26 guests