If I directly telnet to the IP address and port that zmtrigger.pl is running on and send commands, it works as expected and I can trigger alarms via telnet.
But, if I script it as shown in the documentation or have telnet read from a file it does not work, and no errors are logged.
For example this does nothing:
Code: Select all
$ cat for_zm
17|on+10|10|goodbye|goodbye|
$ telnet 192.168.1.1 6802 < for_zm
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.
Connection closed by foreign host.
I see this in strace output of zmtrigger.pl when telnet reads from a file - when it works this is not seen:
Code: Select all
pselect6(8, [4 6], NULL, NULL, {tv_sec=0, tv_nsec=250000000}, NULL) = 1 (in [4], left {tv_sec=0, tv_nsec=80817028})
accept4(4, {sa_family=AF_INET, sin_port=htons(45702), sin_addr=inet_addr("192.168.1.1")}, [4096 => 16], SOCK_CLOEXEC) = 13
fcntl(13, F_SETFD, FD_CLOEXEC) = 0
ioctl(13, TCGETS, 0x7ffe87a8a2e0) = -1 ENOTTY (Inappropriate ioctl for device)
lseek(13, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
fcntl(13, F_SETFD, FD_CLOEXEC) = 0
ioctl(13, TCGETS, 0x7ffe87a8a2e0) = -1 ENOTTY (Inappropriate ioctl for device)
lseek(13, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
sendto(5, "\1\0\0\0\16", 5, MSG_DONTWAIT|MSG_NOSIGNAL, NULL, 0) = 5
recvfrom(5, "\7\0\0\1\0\0\0\2\0\0\0", 16384, MSG_DONTWAIT, NULL, NULL) = 11
pselect6(16, [4 6 13], NULL, NULL, {tv_sec=0, tv_nsec=250000000}, NULL) = 1 (in [13], left {tv_sec=0, tv_nsec=249993784})
read(13, "", 8192) = 0
close(13) = 0
sendto(5, "\1\0\0\0\16", 5, MSG_DONTWAIT|MSG_NOSIGNAL, NULL, 0) = 5
ZM: v1.36.33
Running on up to date Fedora 39, kernel 6.8.10-200.fc39.x86_64
Thanks
-- Patrick