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.
Locked
dhlao
Posts: 14
Joined: Thu Apr 29, 2021 10:23 am

Proper ways to create check command

Post by dhlao »

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.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Proper ways to create check command

Post by mcapra »

Probably missing correctly formatted performance data:
https://nagios-plugins.org/doc/guidelines.html#AEN200
Former Nagios employee
https://www.mcapra.com/
dhlao
Posts: 14
Joined: Thu Apr 29, 2021 10:23 am

Re: Proper ways to create check command

Post by dhlao »

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/nag ... fdata.html. Adding the *stroke* doesn't work.

I've tried using the method in https://github.com/nagios-plugins/nagio ... eck_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/nag ... inapi.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

Post by dhlao »

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.
Locked