Hi,
I’m trying to use the Centreon Linux SNMP script “centreon_linux_snmp.pl” to monitor disk usage.
I was able to configure all the parameters I needed but I’m seeing a strange behavior after I configure a “warning-usage-prct” or “critical-usage-prct”.
For some reason, the output message changes depending if the disk utilization has triggered the warning/critical.
Normal output:
/usr/lib/centreon/plugins/centreon_linux_snmp.pl --plugin=os::linux::snmp::plugin --mode=disk-usage --hostname=192.168.100.42 --snmp-version='3' --snmp-username='snmpuser' --authprotocol='MD5' --authpassphrase='cent1610!' --filter-disk-path='/$' --warning-usage-prct=80
OK: Partition '/' usage total: 23.63 GB used: 17.95 GB (75.94%) free: 5.69 GB (24.06%), Inodes used: 4 % | 'count'=2;;;0; 'used'=19271544832B;;;0;25377501184 'free'=6105956352B;;;0;25377501184 'used_prct'=75.94%;0:80;;0;100 'inodes'=4%;;;0;100
Output when warning/critical is triggered:
/usr/lib/centreon/plugins/centreon_linux_snmp.pl --plugin=os::linux::snmp::plugin --mode=disk-usage --hostname=192.168.100.42 --snmp-version='3' --snmp-username='snmpuser' --authprotocol='MD5' --authpassphrase='cent1610!' --filter-disk-path='/$' --warning-usage-prct=70
WARNING: Partition '/' used: 75.94 % | 'count'=2;;;0; 'used'=19271544832B;;;0;25377501184 'free'=6105956352B;;;0;25377501184 'used_prct'=75.94%;0:70;;0;100 'inodes'=4%;;;0;100
Checking the XML output I noticed that when it’s in warning/critical, there are 2 messages for some reason.
/usr/lib/centreon/plugins/centreon_linux_snmp.pl --plugin=os::linux::snmp::plugin --mode=disk-usage --hostname=192.168.100.42 --snmp-version='3' --snmp-username='snmpuser' --authprotocol='MD5' --authpassphrase='cent1610!' --filter-disk-path='/$' --warning-usage-prct=70 --output-xml
<?xml version="1.0" encoding="utf-8"?>
<plugin>
<name>os::linux::snmp::plugin</name>
<mode>disk-usage</mode>
<exit>WARNING</exit>
<outputs>
<output>
<type>1</type>
<exit>WARNING</exit>
<msg>WARNING: Partition '/' used: 75.93 %</msg>
</output>
<output>
<type>1</type>
<exit>OK</exit>
<msg>OK: Partition '/' usage total: 23.63 GB used: 17.95 GB (75.93%) free: 5.69 GB (24.07%), Inodes used: 4 %</msg>
</output>
</outputs>
<perfdatas>
<perfdata>
<critical/>
<max/>
<value>2</value>
<warning/>
<min>0</min>
<mode>disk-usage</mode>
<unit/>
<label>count</label>
<nlabel>storage.partitions.count</nlabel>
</perfdata>
<perfdata>
<nlabel>storage.space.usage.bytes</nlabel>
<label>used</label>
<unit>B</unit>
<mode>disk-usage</mode>
<min>0</min>
<warning/>
<value>19270103040</value>
<max>25377501184</max>
<critical/>
</perfdata>
<perfdata>
<label>free</label>
<unit>B</unit>
<nlabel>storage.space.free.bytes</nlabel>
<min>0</min>
<mode>disk-usage</mode>
<critical/>
<warning/>
<value>6107398144</value>
<max>25377501184</max>
</perfdata>
<perfdata>
<mode>disk-usage</mode>
<min>0</min>
<max>100</max>
<warning>0:70</warning>
<value>75.93</value>
<critical/>
<nlabel>storage.space.usage.percentage</nlabel>
<unit>%</unit>
<label>used_prct</label>
</perfdata>
<perfdata>
<nlabel>storage.inodes.usage.percentage</nlabel>
<unit>%</unit>
<label>inodes</label>
<mode>disk-usage</mode>
<min>0</min>
<max>100</max>
<warning/>
<value>4</value>
<critical/>
</perfdata>
</perfdatas>
</plugin>
Is this normal / expected behavior ?
I would really prefer if the message information didn’t change and remain like the first one
Partition '/' usage total: 23.63 GB used: 17.95 GB (75.93%) free: 5.69 GB (24.07%), Inodes used: 4 %
From what I can see this behavior only happens when using the “warning-usage-prct” or “critical-usage-prct”, the other variants of the warning/critical don’t have this behavior.