Skip to main content

Need help with SNMP Plugin in Centreon - Numeric Value Issue

I'm encountering an issue with the Centreon SNMP plugin where there's a difference between CLI and GUI execution results.

Command Configuration in Centreon Web Interface:


/usr/lib/centreon/plugins/centreon_generic_snmp.pl
--plugin=apps::protocols::snmp::plugin
--mode=numeric-value
--hostname=xxxxxxxxxxx
--snmp-community='public'
--snmp-version=3
--snmp-username='xxxxxxxxxxx'
--authprotocol='SHA'
--authpassphrase='xxxxxxxxxxx'
--privprotocol='AES'
--privpassphrase='xxxxxxxxxxxx'
--oid='.1.3.6.1.4.1.6101.3004.4.1.4.1.0'
--format='current value is %s'
--warning=
--critical=
--extracted-pattern='([\d\])'

Result in Web Interface:

UNKNOWN: oid value is not numeric (41.31 Kbps)

CLI Command:


/usr/lib/centreon/plugins/centreon_generic_snmp.pl --plugin=apps::protocols::snmp::plugin --mode=numeric-value --hostname=xxxxxxxxxxx --snmp-community='public' --snmp-version=3 --snmp-username='xxxxxxxxxxx' --authprotocol='SHA' --authpassphrase='xxxxxxxxxxx' --privprotocol='AES' --privpassphrase='xxxxxxxxxxx' --oid='.1.3.6.1.4.1.6101.3004.4.1.4.1.0' --format='current value is %s' --warning= --critical= --extracted-pattern='([\d\])'

CLI Result:

OK: current value is 75.31 | 'value'=75.31;;;;

The OID returns a traffic value in Kbps format. How can I make this work properly in Centreon's web interface?

Any help would be greatly appreciated.

Hello,

I don’t know if it’s a copy paste mistake, but the extracted-pattern on the WebConsole command have a comma instead of a dot

Check the pattern you set on the Web console

 

EDIT: Nvm i just saw you edit your post


Hello,

thank u 4 ur answer

yes used the tow way and it the same thing

--extracted-pattern='([\d\.])'

UNKNOWN: oid value is not numeric (.)

 

when i use

--extracted-pattern='((\d\])'
it returns
UNKNOWN: oid value is not numeric (41.31 Kbps)
THX
sorry 4 my english

Hello,

Can you try this pattern?

(\\d+)

 

 


Hello
Great, it works
can you explain to me the principle of patterns
 


--extract-pattern will use a regex you gave him on the result  of the snmpget the plugin did

In the numeric-value mode, the result must be numeric. If not it will give you the error you got

 

The pattern i gave you is pretty much the same you used, but i had an extra \

I add it because i think the centreon engine interpret the \ of the \d+ pattern,like it will escape de the d character (idk if it’s clear )

 

I just put another \ to the first \, so centreon engine will use your original pattern

In my test it worked so i guess it’s something like this happening

 

I hope it helps you


Reply