So if I run the plugin with no explicit thresholds, then defaults of 7 days for warning and 2 days for critical make sense (79 days remaining means it's OK):
/usr/lib64/nagios/plugins/check_nwc_health -H <removed> --mode check-licenses --community <removed> --verbose
OK - entitlement ISR_1100_8P_Security for feature Cisco 1100 Series with 8 LAN Ports, Security License mode is authorized, compliance status is AUTHORIZED, authorization will expire in 79 days
checking keys
entitlement ISR_1100_8P_Security for feature Cisco 1100 Series with 8 LAN Ports, Security License mode is authorized
Registration status is registrationCompleted
compliance status is AUTHORIZED
authorization will expire in 79 days | 'sla_remaining_days'=79;7:;2:;;
However, if I explicitly set the thresholds:
/usr/lib64/nagios/plugins/check_nwc_health -H <removed> --mode check-licenses --community <removed> --verbose --warningx 'sla_remaining_days'=7 --criticalx 'sla_remaining_days'=2
CRITICAL - authorization will expire in 79 days, entitlement ISR_1100_8P_Security for feature Cisco 1100 Series with 8 LAN Ports, Security License mode is authorized, compliance status is AUTHORIZED
checking keys
entitlement ISR_1100_8P_Security for feature Cisco 1100 Series with 8 LAN Ports, Security License mode is authorized
Registration status is registrationCompleted
compliance status is AUTHORIZED
authorization will expire in 79 days | 'sla_remaining_days'=79;7;2;;
I get a CRITICAL result (for the same thresholds).
Furthermore, it looks like it's expecting the threshold to be higher rather than lower (which is the opposite of what it should be - more days left = better):
Setting the warningx threshold lower than the current value results in WARNING:
/usr/lib64/nagios/plugins/check_nwc_health -H <removed> --mode check-licenses --community <removed> --verbose --warningx 'sla_remaining_days'=78
WARNING - authorization will expire in 79 days, entitlement ISR_1100_8P_Security for feature Cisco 1100 Series with 8 LAN Ports, Security License mode is authorized, compliance status is AUTHORIZED
checking keys
entitlement ISR_1100_8P_Security for feature Cisco 1100 Series with 8 LAN Ports, Security License mode is authorized
Registration status is registrationCompleted
compliance status is AUTHORIZED
authorization will expire in 79 days | 'sla_remaining_days'=79;78;2:;;
Set the warningx threshold higher than the current value results in OK:
$ /usr/lib64/nagios/plugins/check_nwc_health -H <removed> --mode check-licenses --community <removed> --verbose --warningx 'sla_remaining_days'=80
OK - entitlement ISR_1100_8P_Security for feature Cisco 1100 Series with 8 LAN Ports, Security License mode is authorized, compliance status is AUTHORIZED, authorization will expire in 79 days
checking keys
entitlement ISR_1100_8P_Security for feature Cisco 1100 Series with 8 LAN Ports, Security License mode is authorized
Registration status is registrationCompleted
compliance status is AUTHORIZED
authorization will expire in 79 days | 'sla_remaining_days'=79;80;2:;;
So if I run the plugin with no explicit thresholds, then defaults of 7 days for warning and 2 days for critical make sense (79 days remaining means it's
OK
):However, if I explicitly set the thresholds:
I get a
CRITICAL
result (for the same thresholds).Furthermore, it looks like it's expecting the threshold to be higher rather than lower (which is the opposite of what it should be - more days left = better):
Setting the
warningx
threshold lower than the current value results inWARNING
:Set the
warningx
threshold higher than the current value results inOK
: