$CENTREONPLUGINS$/centreon_generic_snmp.pl --plugin=apps::protocols::snmp::plugin --mode=string-value --hostname=$HOSTADDRESS$ --snmp-community='$_HOSTSNMPCOMMUNITY$' --snmp-version=$_HOSTSNMPVERSION$ $_HOSTSNMPEXTRAOPTIONS$ --oid='$_SERVICEOID$' --map-values='$_HOSTATTENDU$=>$_HOSTATTENDU$' --map-value-other='Critical' --critical-regexp='Critical' --format-ok='%{details_ok}' --format-critical='%{details_ok} non ok : $_HOSTATTENDU$ attendu' --snmp-autoreduce
if it’s ok --format-ok='%{details_ok}' returne the good value to oid check
but if it’s critical -format-critical='%{details_ok} non ok’ %{details_ok} is empty
they are other way to do this ?
thk
Solved
i want use oid return value on --format-critical
Best answer by vcoum
Can you try you command without the mapping, and with this arguments?
./centreon_generic_snmp.pl --plugin=apps::protocols::snmp::plugin --mode=string-value --hostname=$HOSTADDRESS$ --snmp-community='$_HOSTSNMPCOMMUNITY$' --snmp-version=$_HOSTSNMPVERSION$ $_HOSTSNMPEXTRAOPTIONS$ --oid='$_SERVICEOID$' --format-ok='Current version %{details_ok}' --format-critical='Current version %{details_critical}, Expected version VALEURATTENDU' --critical-regexp='(?!VALEURATTENDU)'The argument critical-regexp will turn the status to Critical if the regex expression match
In your case, i put a negative match, so if the value returned doesn’t match your pattern, the status will be critical
Login to the community
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
