Get the graph (performance data) for a custom Nagios plugin

Hello,

Is there a way to get the graph for a custom Nagios plugin stored in /local/lib/nagios/plugins?

If I put the same script (with little adaptation) in /usr/lib/check_mk_agent/local/ to have a local check, it works well and the graph is available.

I followed this doc: Local checks

The command: echo “0 “My service” myvalue=73;80;90 My output” doesn’t work with a custom Nagios plugin, the graph isn’t available, event if I check the box “performance data” into the rule “Integrate Nagios Plugin”.

Do you have an idea?

Thank you in advance

If you want to execute a Nagios plugin from the checkmk agent on the host have a look at the MRPE mechanism (search on docs.checkmk.com). It will also pass the metrics from the plugin.

Thank for this advice but the goal is to not use the agent because this custom Nagios plugin checks a specific status of internet service, not of a host.

If I use the agent to execute this custom script (MRPE or local check), custom check will be associated with this agent-based host.

Maybe, is there a way to associate the HostA service to the HostB?

Thank you,
Sean

Then you need to have the Nagios plugin in /usr/lib/nagios/plugins on the monitoring server or even better in $OMD_ROOT/local/lib/nagios/plugins of the checkmk site.

In the ruleset “Integrate Nagios Plugin” create a rule that has the command line of the Nagios plugin (including the path if installed in /usr/lib/nagios/plugins). That’s all.

If your question is how to output the metric data from the Nagios plugin then please have a look at the Nagios plugin documentation:

https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/pluginapi.html

1 Like

Yes, that’s it.
Thank you for this link!

Best regards,
Sean