I'm having a terrible time getting external scripts to work.
I had one working, then after a reboot it suddenly quit working, and I haven't been able to get them working again. I was able to get around needing that script with simple checks, but now I'm in need of a script again, and can't get it working.
What I need is a count of waiting e-mails on a pop account. I came up with the following scripts (don't laugh, I'm a scripting newbie! go easy on me!)
Here's what's in the log:
Attached is a screenshot of the item in Zabbix.
What am I doing wrong?
The script works perfectly from the command line as user Zabbix.
I had one working, then after a reboot it suddenly quit working, and I haven't been able to get them working again. I was able to get around needing that script with simple checks, but now I'm in need of a script again, and can't get it working.
What I need is a count of waiting e-mails on a pop account. I came up with the following scripts (don't laugh, I'm a scripting newbie! go easy on me!)
Code:
[root@Zabbix externalscripts]# cat test1.sh /etc/zabbix/externalscripts/test.sh xxx.xxx.xxx.xxx [email protected] xxxxxxx | grep messages | gawk '{print $5;}'
Code:
[root@Zabbix externalscripts]# cat test.sh #!/usr/bin/expect spawn telnet [lindex $argv 0] 110 expect "POP server ready" send "user " send [lindex $argv 1] send "\n" expect "password required for user" send "pass " send [lindex $argv 2] send "\n" expect "messages" send "quit\n"
Code:
3666:20091112:155728 Parameter [test1.sh] is not supported by agent on host [tpmail] Old status [0]
What am I doing wrong?

The script works perfectly from the command line as user Zabbix.
Comment