1

I've been searching high and low for a good explanation of how I should return data from my custom Nagios plugin to make sure that Nagiosgraph will be able to parse it.

One place suggests the format "CPU Usage 98%|c[cpu]=98%;80;95;0;100", while other places suggests variations of this. However, my Nagios does not seem to understand the above format or any other I've tried.

I simply want to be able to draw a graph which plots data points (say, values between 0 and 100) onto a graph. Are there any good resources on this, or does anyone else have any basic examples for this?

Assume I've got two pieces of data : a label (connections) and a value (250). How do I return this to Nagios in a format which enables Nagios to graph this?

Note: I'm asking about 'nagiosgraph' and not 'nagiosgrapher'.

1
  • You might want to try pnp4nagios instead of nagiosgraph, fwiw.
    – Keith
    Dec 9, 2014 at 17:20

2 Answers 2

1

Everything after the pipe is irrelevant, as far as Nagios is concerned. It just stores it or passes is to your perfdata command(s). Perhaps your question is really about getting nagiosgraph to work?

Assuming you have nagiosgraph working, your custom plugin needs to follow the perfdata specifications.

See the Nagios Plugin Development Guidelines for an overview, and the Nagios Plugin API for very detailed information about perfdata specs.

0

While I'm not familiar with nagiosgrapher, in general, your plugins should return performance data in the format expected by nagios as defined in the nagios documentation:

Plugins can return optional performance data in their output by sending the normal, human-readable text string that they usually would, followed by a pipe character (|), and then a string containing one or more performance data metrics. Let's take the check_ping plugin as an example and assume that it has been enhanced to return percent packet loss and average round trip time as performance data metrics. Sample output from the plugin might look like this:

PING ok - Packet loss = 0%, RTA = 0.80 ms | percent_packet_loss=0, rta=0.80

http://nagios.sourceforge.net/docs/3_0/perfdata.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .