What language is used to create the default check commands

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

What language is used to create the default check commands

Post by dhlao »

Just curious about what the default check commands such as "check_ping" and "check-dummy" inside "/libexec" are written in. They're clearly not written in plain text scripts but instead compiled.
I'm planning to make my own check command and want to use the same language that used by Nagios, nothing special, just my personal preference.
While Nagios Core is said to be open source, I don't know if the source codes of those commands are open to public too. It would be nice if I can have some for reference.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: What language is used to create the default check comman

Post by mcapra »

C, for the most part:
https://github.com/nagios-plugins/nagios-plugins

Some Perl, Bash, and Python in there too. Depends on the specific plugin you're looking at.

Here's check_ping and check_dummy:
https://github.com/nagios-plugins/nagio ... ck_dummy.c
https://github.com/nagios-plugins/nagio ... eck_ping.c

But you can write a plugin in practically any language:
https://nagios-plugins.org/doc/guidelines.html

And many mainstream languages already have libraries for writing plugins:
https://pypi.org/project/nagiosplugin/
https://pkg.go.dev/github.com/olorin/nagiosplugin
https://metacpan.org/pod/Monitoring::Plugin
https://crates.io/crates/nagiosplugin
Former Nagios employee
https://www.mcapra.com/
dhlao
Posts: 14
Joined: Thu Apr 29, 2021 10:23 am

Re: What language is used to create the default check comman

Post by dhlao »

Thanks mcapra, I'll go for C then, as I like to compile.
Locked