Create a custom command using API

Hello community,

I am a newbie in the Monitoring field. I am now using the Icinga documentation to learn all about monitoring with Incinga2 using the API.

So far I have created a host, a check command and a service using the API with a Debian Virtual Machine.
Now I am trying to create a custom command that I can use later to push data/where the performance data is filled by me.
I have copied an already existing check command, for example: check_disk into the command that I have created for example: check_test using the curl API. From here on I couldn’t find information or examples/templates how could I proceed further on with this.
Because the check_disk, the command that I copied in in my command, is a binary file I cannot edit it. Also, when I check the command in Icinga web is showing me: “check_disk: Could not parse arguments".
I would like to be able to edit the command file and be able to change the arguments and the title, etc.

May be I tried a wrong approach, please let me know if anyone has different/other ideas or ways to go about it.
Could anybody please instruct me how would be the best to move forward with this? I would really appreciate any help that I can get, thank you.

Kind regards,
Denisa

I’m not entirely sure what you’re trying to accomplish here, but if you want
to be able to modify a check command, you’ll find plenty in the standard
library which are written in bash, perl, or occasionally python, and can
therefore be viewed and modified without needing to recompile and reinstall
them.

That would probably be a good place to start.

https://icinga.com/docs/icinga-2/latest/doc/10-icinga-template-library/ tells
you about all the standard built-in service checks which come with Icinga, and
the Debian package monitoring-plugins will give you a whole load more.

If you install those, you can then look in /usr/lib/nagios/plugins and see
which ones are compiled (“file” will tell you they’re ELF LSB shared object
types) or some sort of scripting language.

Antony.