Skip to content

Conversation

@meni2029
Copy link

@meni2029 meni2029 commented Nov 6, 2019

Re-insert the fallback when the datetime value is 0 (year and month = 0)

The plugin fails with mode hardware-health on Juniper SRX due to value of OID jnxOperatingRestartTime (1.3.6.1.4.1.2636.3.1.13.1.19) equal to "0-0-0,0:0:0.0,.0:0". It fails within the subfunction DateAndTime because epoch cannot be created with year and month = 0.

Plugin output:

# 'check_nwc_health' '--community' 'community' '--hostname' 'ipaddress ' '--mode' 'hardware-health' 
Month '-1' out of range 0..11 at check_nwc_health line 5804.

snmpwalk:

# snmpwalk -v2c -c community ipaddress 1.3.6.1.4.1.2636.3.1.13.1.19
JUNIPER-MIB::jnxOperatingRestartTime.1.1.0.0 = STRING: 2019-10-30,13:51:40.0,+0:0
JUNIPER-MIB::jnxOperatingRestartTime.2.1.0.0 = STRING: 2019-10-30,13:51:40.0,+0:0
JUNIPER-MIB::jnxOperatingRestartTime.7.1.0.0 = STRING: 2019-10-30,13:56:36.0,+0:0
JUNIPER-MIB::jnxOperatingRestartTime.8.1.1.0 = STRING: 2019-10-30,13:56:37.0,+0:0
JUNIPER-MIB::jnxOperatingRestartTime.9.1.0.0 = STRING: 2019-10-30,13:51:40.0,+0:0
JUNIPER-MIB::jnxOperatingRestartTime.9.1.1.0 = STRING: 0-0-0,0:0:0.0,.0:0

The piece of code added in this pull request was removed by commit dcdb758

Re-insert the fallback when the datetime value is 0 (year and month = 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant