# you can disable an alarm notification by setting the 'to' line to: silent

# --- Availability: BGP Peer State ---

 template: panos_bgp_peer_not_established
       on: panos.bgp.peer.state
    class: Availability
     type: Network
component: Palo Alto Networks NGFW
   lookup: min -5m unaligned of established
    units: state
    every: 1m
     crit: $this != nan AND $this < 1
    delay: down 5m multiplier 1.5 max 1h
  summary: PAN-OS BGP peer ${label:peer_address} is not established
     info: BGP peer ${label:peer_address} in virtual router or logical router ${label:vr} \
           has not been established for the last 5 minutes
       to: sysadmin

# --- System: Device Certificate ---

 template: panos_device_certificate_invalid
       on: panos.system.device_certificate_status
    class: Errors
     type: Network
component: Palo Alto Networks NGFW
   lookup: max -5m unaligned of invalid
    units: status
    every: 1m
     crit: $this != nan AND $this > 0
  summary: PAN-OS device certificate is not valid
     info: PAN-OS reports the device certificate status as invalid
       to: sysadmin

# --- Availability: HA ---

 template: panos_ha_peer_connection_down
       on: panos.ha.peer.connection_status
    class: Availability
     type: Network
component: Palo Alto Networks NGFW
   lookup: min -5m unaligned of up
    units: status
    every: 1m
     crit: $this != nan AND $this < 1
    delay: down 5m multiplier 1.5 max 1h
  summary: PAN-OS HA peer connection is down
     info: PAN-OS HA peer connection has not been up for the last 5 minutes
       to: sysadmin

# --- Hardware: Environment Sensors ---

 template: panos_environment_sensor_alarm
       on: panos.environment.sensor_alarm_status
    class: Errors
     type: Network
component: Palo Alto Networks NGFW
   lookup: max -5m unaligned of alarm
    units: status
    every: 1m
     crit: $this != nan AND $this > 0
  summary: PAN-OS environment sensor ${label:sensor} is in alarm
     info: PAN-OS reports an environment alarm for ${label:sensor_type} sensor ${label:sensor} in slot ${label:slot}
       to: sysadmin

# --- Licensing ---

 template: panos_license_expired
       on: panos.license.status
    class: Errors
     type: Network
component: Palo Alto Networks NGFW
   lookup: max -5m unaligned of expired
    units: status
    every: 1m
     crit: $this != nan AND $this > 0
  summary: PAN-OS license ${label:feature} is expired
     info: PAN-OS reports license ${label:feature} as expired
       to: sysadmin

 template: panos_license_expires_soon
       on: panos.license.time_until_expiration
    class: Errors
     type: Network
component: Palo Alto Networks NGFW
   lookup: min -1h unaligned of time_until_expiration
    units: days
    every: 10m
     warn: $this != nan AND $this >= 0 AND $this < 30
     crit: $this != nan AND $this >= 0 AND $this < 7
  summary: PAN-OS license ${label:feature} expires soon
     info: PAN-OS license ${label:feature} has less than 30 days before expiration; expired licenses trigger panos_license_expired
       to: sysadmin
