Hello all,
I am trying to administer a system remotely and I am having a problem with zm losing connection with cameras. I am tracking down possible problems with shared memory settings, but is there a way for zm to notify if/when it loses a camera? It would make troubleshooting alot easier and would be a useful feature during normal operation as well.
Any help or suggestions you might offer is greatly appreciated.
-- Sniz
Notify on camera loss, possible? UPDATED / RESOLVED (sort of
Notify on camera loss, possible? UPDATED / RESOLVED (sort of
Last edited by sniz on Tue Sep 22, 2009 11:46 am, edited 1 time in total.
UPDATED / RESOLVED (sort of...)
Thanks for the fast response, cordel. I hadn't seen logwatch, but I think I managed to find workable (meaning "Quick and Dirty") solution with swatch.
From what I can tell, main difference between them is that logwatch will parse the log files for desired info as a cron job, and output the results in the desired manner, while swatch will actually monitor the log files as they are being written, looking for matches to text patterns in the form of regular expressions, and send an email or execute a command when it finds one.
(LinuxJournal published an article about installing, configuring, and using swatch back in Aug. '01. You can read it here )
What I did was set swatch to monitor syslog for /Select timed out/, and execute a command that will send an empty email (just headers) with a subject like "Oh_@#$%_ a_camera_is_out" when a matching new entry is written. I don't get any camera-specific info, but I do get notified immediately instead of waiting for the next scheduled cron job.
What do you think?
From what I can tell, main difference between them is that logwatch will parse the log files for desired info as a cron job, and output the results in the desired manner, while swatch will actually monitor the log files as they are being written, looking for matches to text patterns in the form of regular expressions, and send an email or execute a command when it finds one.
(LinuxJournal published an article about installing, configuring, and using swatch back in Aug. '01. You can read it here )
What I did was set swatch to monitor syslog for /Select timed out/, and execute a command that will send an empty email (just headers) with a subject like "Oh_@#$%_ a_camera_is_out" when a matching new entry is written. I don't get any camera-specific info, but I do get notified immediately instead of waiting for the next scheduled cron job.
What do you think?
-
- Posts: 184
- Joined: Tue Oct 14, 2008 5:59 pm
pinging
Hi all, may be is enought just to do a simply file like this (it is just a mini-example):
Code: Select all
#!/bin/bash
# Programa que pide una direccion IP al usuario y reliza un 3 pings con interva$
ipa=myotherserver.com
ipb=google.com
#ipc=yahoo.com
if $(ping -c3 -i 2 $ipa > /dev/null) ;then
#echo "La maquina $ip esta arriba (up)" | mail -s resultado email@email.com
A1=1
else
#echo "La maquina $ip esta abajo (down)" | mail -s resultado email@email.com
A1=0
fi
if $(ping -c3 -i 2 $ipb > /dev/null) ;then
B1=1
else
B1=0
fi
CERO=0
RESULT=$A1+$B1
if [$RESULT -gt $CERO ]; then
echo "La maquina $ip esta arriba (up)" | mail -s resultado email@email.com
else
echo "La maquina $ip esta abajo (down)" | mail -s resultado email@email.com
fi
Re: pinging
I'm sorry, I should have been more clear. See, my cameras are fine. It's zm that suddenly can't connect to a camera. The camera is up and running but zm requires a restart to restore the connection.johnnytolengo wrote:Hi all, may be is enought just to do a simply file like this (it is just a mini-example): ...
So I what I need is to be notified if/when zm turns the camera text "red", so I can then find out why.
-
- Posts: 184
- Joined: Tue Oct 14, 2008 5:59 pm