Guest User

Zabbix IRC sender scripts

a guest
Feb 22nd, 2013
433
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/expect -f
  2. # Zabbix IRC sender script
  3.  
  4. set force_conservative 0  ;# set to 1 to force conservative mode even if
  5.               ;# script wasn't run conservatively originally
  6. if {$force_conservative} {
  7.     set send_slow {1 .1}
  8.     proc send {ignore arg} {
  9.         sleep .1
  10.         exp_send -s -- $arg
  11.     }
  12. }
  13.  
  14. set timeout -1
  15. spawn telnet localhost 1033 #eggdrop bot listening on 1033/TCP
  16. match_max 100000
  17. expect "Nickname.\r"
  18. send -- "zabbix-sr\r"
  19. expect "Enter your password.\r"
  20. send -- "password\r"
  21. expect -exact "*** zabbix-sr joined the party line.\r"
  22. send -- ".msg #channel [lindex $argv]\r"
  23. expect ".msg #channel [lindex $argv]\r"
  24. send -- ".quit\r"
  25. expect eof
  26.  
  27. -=-=-=-=-=-=-=-=-=-=-=-=-
  28.  
  29. #!/bin/bash
  30. # IRC Caller for Zabbix Alert
  31. DEBUG=0
  32.  
  33. usr=$1
  34. msg=$2
  35.  
  36. /usr/lib/zabbix/alertscripts/zabbix_irc $msg
RAW Paste Data