We've moved to a new support system!

The Nagios Answer Hub is a place where you can get help with technical questions from our experts. There, you can quickly open tickets and join discussion boards.

Request Nagios Answer Hub access here: https://info.nagios.com/answer-hub-access-new-users

After completing the access form, you will be given access to a portal where new tickets can be created. We will keep the old customer forum sections and ticket system available for current cases to be resolved.

Go to the Answer Hub

Proper ways to create check command

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

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 Community Support

Who is online

Users browsing this forum: No registered users and 23 guests