Performance graphs with check_snmp?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
juergen
Posts: 8
Joined: Tue Oct 21, 2025 12:41 pm

Performance graphs with check_snmp?

Post by juergen »

Hello,

Running the special edition of Nagios XI 2024R1.3.3.

I seem to have some very fundamental problems wrapping my mind around how to produce performance graphs. I was under the impression that all I need is to return performance data separated from the rest of the output by a pipe symbol, and graphs would 'magically' appear.

I would like to graph the temperature of two CPU's in one of my computers. To this end, I have created a script that is surfaced through SNMP. So, for example, snmpget -v 2c -c public 10.0.0.11 .ucdavis UCD-SNMP-MIB::extOutput.1 would give me UCD-SNMP-MIB::extOutput.1 = STRING: CPU0: 42.0C; CPU1: 26.0C | CPU0=42.0C CPU1=26.0C.

The Nagios check is set up like this:

Code: Select all

define service {
    host_name                 10.0.0.11
    service_description       CPU Temperature
    use                       xiwizard_snmp_service
    check_command             check_xi_service_snmp!-o 'UCD-SNMP-MIB::extOutput.1' -C 'public' -P 2c!!!!!!!
    max_check_attempts        5
    check_interval            1
    retry_interval            1
    check_period              xi_timeperiod_24x7
    notification_interval     60
    notification_period       xi_timeperiod_24x7
    contacts                  nagiosadmin
    _xiwizard                 snmp
    register                  1
}
The check shows up in Nagios, and correctly displays the part before the pipe symbol. A performance graph is created - but it does not show any data.

Can you please give me a pointer to what steps I have missed?

Thanks!
kg2857
Posts: 490
Joined: Wed Apr 12, 2023 5:48 pm

Re: Performance graphs with check_snmp?

Post by kg2857 »

Run the contents of the check_xi_service_snmp command in the shell as the nahios user with -h or whatever the help argument is.
snmpget is not a nagios plugin so it won't provide output nagios will interpret as perfdata.
juergen
Posts: 8
Joined: Tue Oct 21, 2025 12:41 pm

Re: Performance graphs with check_snmp?

Post by juergen »

The check command evaluates to /usr/local/nagios/libexec/check_snmp -H 10.0.0.11 -o 'UCD-SNMP-MIB::extOutput.1' -C 'public' -P 2c.

I don't see much specific information about performance graphs in the output of check_snmp -h. An option to label performance graphs with OIDs instead of labels - but that can't be it.

Running the full command gives me SNMP OK - CPU0: 44.0C; CPU1: 26.0C | CPU0=44.0C CPU1=26.0C |. Could the pipe symbol at the end of the output be the issue? How would it have gotten there? There is no pipe symbol at the end of the snmpget output.

Thanks!
juergen
Posts: 8
Joined: Tue Oct 21, 2025 12:41 pm

Re: Performance graphs with check_snmp?

Post by juergen »

An update: I created a super simple command that just fetches a value over SNMP: /bin/snmpget $ARG1$ $HOSTADDRESS$ $ARG2$. This makes the check command /bin/snmpget -c 'public' -v 2c -Oqv 10.0.0.11 UCD-SNMP-MIB::extOutput.1, and the output CPU0: 44.0C; CPU1: 25.0C|CPU0=44.0C CPU1=25.0C (no trailing pipe symbol).

In that configuration, Nagios charts the CPU temperatures just the way I expected. I can live with that workaround, but I still wonder where check_snmp came up with that trailing pipe symbol
kg2857
Posts: 490
Joined: Wed Apr 12, 2023 5:48 pm

Re: Performance graphs with check_snmp?

Post by kg2857 »

Have a look at the perfdata files for the service. They may need to be removed to get the data to be stored.
The extra pipe char seems odd.
juergen
Posts: 8
Joined: Tue Oct 21, 2025 12:41 pm

Re: Performance graphs with check_snmp?

Post by juergen »

You are right - I did have to remove the .rrd file from earlier experiments to store the data. Everything works fine now (except that I'm not using check_snmp).

Thanks!
Post Reply