192
Chapter 14: Command Line Configuration
14.1.13 Alerts
Youcanaddanemail,SNMPorNAGIOSalertbyfollowingthestepsbelow.
The general settings for all alerts
Assumethisisoursecondalert,andwewanttosendalertemailstojohn@company.comandsms'stopeter@compnany.
com:
# config -s config.alerts.alert2.description=MySecondAlert
# config -s config.alerts.alert2.email=john@company.com
# config -s config.alerts.alert2.email2=peter@company.com
TouseNAGIOStonotifyofthisalert:
# config -s config.alerts.alert2.nsca.enabled=on
TouseSNMPtonotifyofthisalert:
# config -s config.alerts.alert2.snmp.enabled=on
Increment the total alerts:
# config -s config.alerts.total=2
Below are the specific settings depending on the type of alert required:
Connection Alert
To trigger an alert when a user connects to serial port 5 or network host 3:
# config -s config.alerts.alert2.host3='host name'
# config -s config.alerts.alert2.port5=on
# config -s config.alerts.alert2.sensor=temp
# config -s config.alerts.alert2.signal=DSR
# config -s config.alerts.alert2.type=login
Signal Alert
To trigger an alert when a signal changes state on port 1:
# config -s config.alerts.alert2.port1=on
# config -s config.alerts.alert2.sensor=temp
# config -s config.alerts.alert2.signal=[ DSR | DCD | CTS ]
# config -s config.alerts.alert2.type=signal
Pattern Match Alert
To trigger an alert if the regular expression '.*0.0% id' is found in serial port 10's character stream:
# config -s "config.alerts.alert2.pattern=.*0.0% id"
# config -s config.alerts.alert2.port10=on
# config -s config.alerts.alert2.sensor=temp
# config -s config.alerts.alert2.signal=DSR
# config -s config.alerts.alert2.type=pattern
UPS Power Status Alert
To trigger an alert when myUPS(onlocalhost)orthatUPS(onremotehost192.168.0.50)powerstatuschangesbetweenon
line,onbatteryandlowbattery:
# config -s config.alerts.alert2.sensor=temp
# config -s config.alerts.alert2.signal=DSR
# config -s config.alerts.alert2.type=ups
# config -s config.alerts.alert2.ups1=myUPS@localhost
# config -s config.alerts.alert2.ups2=thatUPS@192.168.0.50