forked from kylesv/Zabbix_
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathZBX_IRC_sender_script.txt
39 lines (30 loc) · 1007 Bytes
/
ZBX_IRC_sender_script.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/expect -f
# Zabbix IRC sender script
set force_conservative 0 ;# set to 1 to force conservative mode even if
;# script wasn't run conservatively originally
if {$force_conservative} {
set send_slow {1 .1}
proc send {ignore arg} {
sleep .1
exp_send -s -- $arg
}
}
set timeout -1
spawn telnet localhost 1033 #eggdrop bot listening on 1033/TCP
match_max 100000
expect "Nickname.\r"
send -- "zabbix-sr\r"
expect "Enter your password.\r"
send -- "password\r"
expect -exact "*** zabbix-sr joined the party line.\r"
send -- ".msg #channel [lindex $argv]\r"
expect ".msg #channel [lindex $argv]\r"
send -- ".quit\r"
expect eof
-=-=-=-=-=-=-=-=-=-=-=-=-
#!/bin/bash
# IRC Caller for Zabbix Alert
DEBUG=0
usr=$1
msg=$2
/usr/lib/zabbix/alertscripts/zabbix_irc $msg