Syslog Monitoring - Unix

This is a discussion on Syslog Monitoring - Unix ; I have a process that will post an entry into syslog periodically when
it is working properly rather than when it isn't. When the process
'breaks' this heartbeat entry will no longer be put into the log.
I need a ...

Syslog Monitoring

I have a process that will post an entry into syslog periodically when
it is working properly rather than when it isn't. When the process
'breaks' this heartbeat entry will no longer be put into the log.

I need a script to monitor for a negative -- that is to say, I need to
know how many minutes it has been since the even happened last. Of
course, accounting for change of day, month and year.

Does anyone have a script that does this?

Re: Syslog Monitoring

Gerry S. wrote:
> I have a process that will post an entry into syslog periodically when
> it is working properly rather than when it isn't. When the process
> 'breaks' this heartbeat entry will no longer be put into the log.
>
> I need a script to monitor for a negative -- that is to say, I need to
> know how many minutes it has been since the even happened last. Of
> course, accounting for change of day, month and year.
>
> Does anyone have a script that does this?
>

Re: Syslog Monitoring

Ed Morton wrote:
> Gerry S. wrote:
>
>> I have a process that will post an entry into syslog periodically when
>> it is working properly rather than when it isn't. When the process
>> 'breaks' this heartbeat entry will no longer be put into the log.
>>
>> I need a script to monitor for a negative -- that is to say, I need to
>> know how many minutes it has been since the even happened last. Of
>> course, accounting for change of day, month and year.
>>
>> Does anyone have a script that does this?
>>
>
> Does this do what you want:
>
> while :
> do
> mtime=`stat -c "%y" syslog`
> [ "$mtime" = "$prevMtime" ] && echo "No update!"
> prevMtime="$mtime"

Adding a "sleep" might not be a bad idea ;-), e.g

sleep 60
> done
>
> Regards,
>
> Ed.

Re: Syslog Monitoring

I'm sure the sleep would help quite a bit

Is stat built into the shell? What shell are you using...

I think I can make this work, the shell script would be called by our
monitoring system (Tivoli ) then based on STDOUT or an exit code it
would generate the notification..

-G

Re: Syslog Monitoring

Gerry S. wrote:
> I'm sure the sleep would help quite a bit
>
> Is stat built into the shell?

It depends... normally ksh88 on Solaris, or bash on cygwin (yes, I know,
it's not a real OS, but it does what I want) on Windows XP.
> I think I can make this work, the shell script would be called by our
> monitoring system (Tivoli ) then based on STDOUT or an exit code it
> would generate the notification..

Feel free to post the final version for comments, but please read this
first: