Page 1 of 1

What language is used to create the default check commands

Posted: Sun Sep 12, 2021 11:26 pm
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.

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

Posted: Mon Sep 13, 2021 8:05 am
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

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

Posted: Tue Sep 14, 2021 5:00 am
by dhlao
Thanks mcapra, I'll go for C then, as I like to compile.