# Network device licensing alerts from the SNMP collector.

 template: snmp_license_expiring
       on: snmp.license.remaining_time
    class: Errors
     type: NetworkDevice
component: Licensing
     calc: $remaining_time / 86400
    units: days
    every: 60s
     warn: $this < 30
     crit: $this < 7
  summary: SNMP device license expiring soon
     info: The earliest monitored SNMP license or subscription on this device is close to expiration.
       to: sysadmin

 template: snmp_license_authorization_expiring
       on: snmp.license.authorization_remaining_time
    class: Errors
     type: NetworkDevice
component: Licensing
     calc: $remaining_time / 86400
    units: days
    every: 60s
     warn: $this < 30
     crit: $this < 7
  summary: SNMP device license authorization expiring soon
     info: The license authorization timer on this device is close to expiration.
       to: sysadmin

 template: snmp_license_certificate_expiring
       on: snmp.license.certificate_remaining_time
    class: Errors
     type: NetworkDevice
component: Licensing
     calc: $remaining_time / 86400
    units: days
    every: 60s
     warn: $this < 30
     crit: $this < 7
  summary: SNMP device licensing certificate expiring soon
     info: The license certificate timer on this device is close to expiration.
       to: sysadmin

 template: snmp_license_grace_period_ending
       on: snmp.license.grace_remaining_time
    class: Errors
     type: NetworkDevice
component: Licensing
     calc: $remaining_time / 86400
    units: days
    every: 60s
     warn: $this < 7
     crit: $this <= 0
    delay: down 5m multiplier 1.5 max 1h
  summary: SNMP device licensing grace period ending
     info: The licensing grace or evaluation period on this device is ending or already expired.
       to: sysadmin

 template: snmp_license_state_warning
       on: snmp.license.state
    class: Errors
     type: NetworkDevice
component: Licensing
     calc: $degraded
    units: licenses
    every: 60s
     warn: $this > 0
  summary: SNMP device licensing degraded
     info: One or more monitored licenses on this device are degraded, in grace, or otherwise in warning state.
       to: sysadmin

 template: snmp_license_state_critical
       on: snmp.license.state
    class: Errors
     type: NetworkDevice
component: Licensing
     calc: $broken
    units: licenses
    every: 60s
     crit: $this > 0
  summary: SNMP device licensing broken
     info: One or more monitored licenses on this device are expired, invalid, unauthorized, or otherwise in critical state.
       to: sysadmin

 template: snmp_license_usage_high
       on: snmp.license.usage_percent
    class: Utilization
     type: NetworkDevice
component: Licensing
     calc: $usage_percent
    units: percentage
    every: 60s
     warn: $this >= 80
     crit: $this >= 95
  summary: SNMP device licensing usage is high
     info: The most constrained monitored license pool on this device is nearing exhaustion.
       to: sysadmin
