#! /usr/bin/ruby1.8 # == Synopsis # # mauvesend: send alert(s) to a given alert station # # == Usage # # mauvesend [destination] # [--source | -o ] [--replace | -p] [--verbose | -v] # [--id [alert options] ... ] # # : # where the alert should go, can be one of: # SRV record from DNS (we add _mauvealert._udp to record name) # normal hostname (i.e. A record) # IP address:port number # # if no destination is supplied, reads parameter from file # /etc/mauvealert/mauvesend.destination (otherwise throws an error). # # --source | -o : # identify the source of the alert (defaults to hostname, but you might # want to name your monitoring systems more explicitly). # # --replace | -p: # Send an update replacing all other alerts for this source - any previous # alerts not specified in this update are assumed to be cleared. If you # specify this option, you don't have to supply *any* alerts to raise or # clear (in which case all alerts from that source will be cleared). # # --verbose | -v: # If you specify this option once, it will print the transmission ID # of the packet for debugging. If you specify it twice, it will print # the entire data structure. # # You can specify any number of alerts in an update - every time you specify # --id starts a new alert. # # --id | -i : # alert ID; unique specified for each alert raised. # # --summary | -s : # text for humans describing the nature of the alert, first 100 characters # are only ones guaranteed to make it to pagers, twitter, SMS etc. # # --detail | -d : # HTML fragment describing the alert in more detail, no limit on length. # # --subject | -u : # set the subject of the alert (i.e. the server/entity that this alert # concerns). # # --clear | -c