reading errors from logs

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
User avatar
TFC
Cacti Pro User
Posts: 739
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

reading errors from logs

Post by TFC »

Hi, I have many rrd files(about 3000) and some rrd files are unused or produces error. I need to clean my rra folder from error or unused files.
In my crontab:
*/5 * * * * root cd /usr/local/cactid/bin; ./cactid > /dev/null 2>&1
So, my output goes to waste. Then I change this:
*/5 * * * * root cd /usr/local/cactid/bin; ./cactid > /tmp/cactid.out 2>&1
Thus, I collect all cactid output. OKs and ERRORs. But there are so many lines and I can't select errors. Is there any way to collect only errors?
My another aim is tı collect error logs, such as, which rrd file is not working properly, which file is unused.Then HPOV collect these logs and produce alarms.
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

You can try this one:
*/5 * * * * root cd /usr/local/cactid/bin; ./cactid > /dev/null 2>/tmp/cactid.out
- Piotr
maenu
Cacti User
Posts: 57
Joined: Thu Jul 17, 2003 8:55 am
Location: Switzerland

Post by maenu »

you can use grep to filter out what you're intrested in...

$ grep -i error /tmp/cactid.out

=> prints out all lines which contain the word "error"
(case-insensitive)

of course, you can put a grep directly into crontab... but I think it makes more sense if you grep through a "offline" cactid.out

$ man grep

regards, manuel
To know recursion, you must first know recursion.
User avatar
TFC
Cacti Pro User
Posts: 739
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

Post by TFC »

bulek wrote:You can try this one:
*/5 * * * * root cd /usr/local/cactid/bin; ./cactid > /dev/null 2>/tmp/cactid.out
- Piotr
I did. But ı get this:
[root@cacti tmp]# more cactid.out
wc: /var/log/httpd/access_log: No such file or directory
what does it mean?
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

This means that wc utility which counts your lines in apache log file can't find a file named "/var/log/httpd/access_log". Hmm... maybe your file is named "access.log"? Anyway you need to change it in webhits.pl script in which the name is hardcoded.

- Piotr
User avatar
TFC
Cacti Pro User
Posts: 739
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

Post by TFC »

bulek wrote:This means that wc utility which counts your lines in apache log file can't find a file named "/var/log/httpd/access_log". Hmm... maybe your file is named "access.log"? Anyway you need to change it in webhits.pl script in which the name is hardcoded.

- Piotr
Thanks I change the script as /www/logs/access_log
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests