Wanna see older logs

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
cesar.garza
Posts: 80
Joined: Mon Aug 19, 2013 3:14 pm

Wanna see older logs

Post by cesar.garza »

Hey people
I was wondering how can i see two dates nagios older log by date and time. Right now i can only see whatever is in there but not able to see older logs. I m using tail command to see the logs.
Please let me know if you know how to see that...
Thanks
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Wanna see older logs

Post by tmcdonald »

I'm a little clear about what you need. Are you just running "tail nagios.log"? Are you checking rotated logs?
Former Nagios employee
cesar.garza
Posts: 80
Joined: Mon Aug 19, 2013 3:14 pm

Re: Wanna see older logs

Post by cesar.garza »

tmcdonald wrote:I'm a little clear about what you need. Are you just running "tail nagios.log"? Are you checking rotated logs?
whenever i wanna see the older log like few hours or minute...i am using this command
tail -1000 nagios.log

but now i wanna see two days older log. I could use this command like tail -1000 nagios.log | grep servicename
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Wanna see older logs

Post by abrist »

Nagios rotates logs. Check the archives folder for older logs:

Code: Select all

ls /usr/local/nagios/var/archives/
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked