Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[network::stormshield::snmp::plugin] --mode=hardware --component=temperature: Use of uninitialized value in pattern match (m//) #5182

Open
DocBlack89 opened this issue Sep 11, 2024 · 3 comments

Comments

@DocBlack89
Copy link

Plugin version : 20240909 and before

Hello,

When trying to get the temperature of the CPU on a stormshield equipment and to add a trigger for warning and critical, the following error occurs.
The temperature is well get (OID ok), but the operation for the status don't work

/opt/centreon-plugins/centreon_plugins.pl --host XXXXX --authpassphrase XXXXX --privpassphrase XXXXX --snmp-username XXXXX --authprotocol XXXXX --privprotocol XXXXX --plugin network::stormshield::snmp::plugin --mode hardware --component=temperature --warning 'temperature,.*,20' --critical 'temperature,.*,50'  --snmp-version 3
Use of uninitialized value $options{"value"} in pattern match (m//) at /opt/centreon-plugins/centreon/plugins/perfdata.pm line 110.
Use of uninitialized value $options{"value"} in numeric lt (<) at /opt/centreon-plugins/centreon/plugins/perfdata.pm line 117.
Use of uninitialized value $options{"value"} in numeric gt (>) at /opt/centreon-plugins/centreon/plugins/perfdata.pm line 117.
Use of uninitialized value $options{"value"} in pattern match (m//) at /opt/centreon-plugins/centreon/plugins/perfdata.pm line 110.
Use of uninitialized value $options{"value"} in numeric lt (<) at /opt/centreon-plugins/centreon/plugins/perfdata.pm line 117.
Use of uninitialized value $options{"value"} in numeric gt (>) at /opt/centreon-plugins/centreon/plugins/perfdata.pm line 117.
Use of uninitialized value $options{"value"} in pattern match (m//) at /opt/centreon-plugins/centreon/plugins/perfdata.pm line 110.
Use of uninitialized value $options{"value"} in numeric lt (<) at /opt/centreon-plugins/centreon/plugins/perfdata.pm line 117.
Use of uninitialized value $options{"value"} in numeric gt (>) at /opt/centreon-plugins/centreon/plugins/perfdata.pm line 117.
Use of uninitialized value $options{"value"} in pattern match (m//) at /opt/centreon-plugins/centreon/plugins/perfdata.pm line 110.
Use of uninitialized value $options{"value"} in numeric lt (<) at /opt/centreon-plugins/centreon/plugins/perfdata.pm line 117.
Use of uninitialized value $options{"value"} in numeric gt (>) at /opt/centreon-plugins/centreon/plugins/perfdata.pm line 117.
OK: All 2 components are ok [2/2 temperatures]. | 'cpu0#hardware.temperature.celsius'=68C;0:20;0:50;0; 'cpu1#hardware.temperature.celsius'=68C;0:20;0:50;0; 'hardware.temperature.count'=2;;;;

Is there any workaround for this ?
Thanks

@lucie-dubrunfaut
Copy link
Contributor

Hello :)

Can you, please give us the output with --debug option or better an extract of the data (SNMPWalk) to work on this issue ?

@lucie-dubrunfaut
Copy link
Contributor

Maybe you can try with the fix proposed here : #5188

@DocBlack89
Copy link
Author

DocBlack89 commented Sep 13, 2024

Hello !

Your fix work perfectly on my side ! Thanks !

If you still need, here is the result of both --debug and the snmpwalk :

Use of uninitialized value $options{"value"} in pattern match (m//) at /usr/lib/nagios/plugins/centreon-plugins-master/centreon/plugins/perfdata.pm line 110.
Use of uninitialized value $options{"value"} in numeric lt (<) at /usr/lib/nagios/plugins/centreon-plugins-master/centreon/plugins/perfdata.pm line 117.
Use of uninitialized value $options{"value"} in numeric gt (>) at /usr/lib/nagios/plugins/centreon-plugins-master/centreon/plugins/perfdata.pm line 117.
Use of uninitialized value $options{"value"} in pattern match (m//) at /usr/lib/nagios/plugins/centreon-plugins-master/centreon/plugins/perfdata.pm line 110.
Use of uninitialized value $options{"value"} in numeric lt (<) at /usr/lib/nagios/plugins/centreon-plugins-master/centreon/plugins/perfdata.pm line 117.
Use of uninitialized value $options{"value"} in numeric gt (>) at /usr/lib/nagios/plugins/centreon-plugins-master/centreon/plugins/perfdata.pm line 117.
Use of uninitialized value $options{"value"} in pattern match (m//) at /usr/lib/nagios/plugins/centreon-plugins-master/centreon/plugins/perfdata.pm line 110.
Use of uninitialized value $options{"value"} in numeric lt (<) at /usr/lib/nagios/plugins/centreon-plugins-master/centreon/plugins/perfdata.pm line 117.
Use of uninitialized value $options{"value"} in numeric gt (>) at /usr/lib/nagios/plugins/centreon-plugins-master/centreon/plugins/perfdata.pm line 117.
Use of uninitialized value $options{"value"} in pattern match (m//) at /usr/lib/nagios/plugins/centreon-plugins-master/centreon/plugins/perfdata.pm line 110.
Use of uninitialized value $options{"value"} in numeric lt (<) at /usr/lib/nagios/plugins/centreon-plugins-master/centreon/plugins/perfdata.pm line 117.
Use of uninitialized value $options{"value"} in numeric gt (>) at /usr/lib/nagios/plugins/centreon-plugins-master/centreon/plugins/perfdata.pm line 117.
OK: All 2 components are ok [2/2 temperatures]. | 'cpu0#hardware.temperature.celsius'=67C;0:40;0:50;0; 'cpu1#hardware.temperature.celsius'=67C;0:40;0:50;0; 'hardware.temperature.count'=2;;;;
.1.3.6.1.4.1.11256.1.10.7.1.2.0 = 67
.1.3.6.1.4.1.11256.1.10.7.1.2.1 = 67
checking temperatures
temperature 'cpu0' is 67 celsius [instance: cpu0]
temperature 'cpu1' is 67 celsius [instance: cpu1]

snmpwalk on the oid .1.3.6.1.4.1.11256.1.10.7

SNMPv2-SMI::enterprises.11256.1.10.7.1.1.0 = INTEGER: 0
SNMPv2-SMI::enterprises.11256.1.10.7.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.11256.1.10.7.1.2.0 = INTEGER: 67
SNMPv2-SMI::enterprises.11256.1.10.7.1.2.1 = INTEGER: 67

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants