cancel
Showing results for 
Search instead for 
Did you mean: 

Monitor Script Help

SOLVED
Go to solution
VICBUR1507
Frequent Advisor

Monitor Script Help

Hi Guys,
I have a script to monitor my servers HP-UX, but I need to filter the syslog.log and old syslog.log to just show me the logs of the current day and previous day log.
Annex the entire script to see how I can help.

Greetings,
3 REPLIES
Dennis Handly
Acclaimed Contributor
Solution

Re: Monitor Script Help

One minor point. You continually evaluate the name of the logfile. You should assign it to a variable and use that:
LOG=/tmp/moni_diario/$(hostname)_$(date "+%m-%d-%y").txt

And replace your more(1) by cat(1):
cat /var/adm/syslog/mail.log >> $LOG

>I need to filter the syslog.log and old syslog.log to just show me the logs of the current day and previous

Can you provide a few lines so we know the format?
George Spencer_4
Frequent Advisor

Re: Monitor Script Help

Hi,

Assuming that the old syslog is OLDsyslog.log, you could:

cd /var/adm/syslog
cat *syslog.log | monitor_script

This will concatenate the two files into a single data stream, and pipe it into your monitoring script.

Hope that helps,

George
VICBUR1507
Frequent Advisor

Re: Monitor Script Help

Thanks+}