PDA

View Full Version : Last internet access time



tech291083
13th May 2007, 01:48 PM
Hi,

How can one know when was the last time internet was accessed? Thanks..

paul matthijsse
13th May 2007, 01:51 PM
look in /var/log/messages

tech291083
13th May 2007, 01:55 PM
look in /var/log/messages

Hi thanks, but can't find /var/log/messages. Any idea ?

paul matthijsse
13th May 2007, 02:00 PM
it's the file 'messages' located in /var/log. you need to be root to open it. look for a line with ntpd (the network time protocol deamon, if that service is activated on your machine, that is) and it will tell you the last time it synchronized with a time server.

lmo
13th May 2007, 02:01 PM
su
less /var/log/messages

(less: h-help, Up/DownArrow, PageUp/Down, Home-Top, End-Bottom, /searchpattern)

tech291083
13th May 2007, 09:34 PM
su
less /var/log/messages

(less: h-help, Up/DownArrow, PageUp/Down, Home-Top, End-Bottom, /searchpattern)

Thanks, this is the output of the command that you gave me. How do I work out the last time I accessed the internet? Thanks..

May 13 15:54:05 localhost syslogd 1.4.1: restart.
May 13 15:55:10 localhost kernel: audit(1179068110.102:11): avc: denied { read } for pid=424
7 comm="prelink" name="timezlrg.dat" dev=dm-0 ino=2720284 scontext=system_u:system_r:prelink_t:
s0 tcontext=user_u:object_r:user_home_t:s0 tclass=file
May 13 15:55:10 localhost kernel: audit(1179068110.102:12): avc: denied { read } for pid=424
7 comm="prelink" name="timezone.dat" dev=dm-0 ino=2720285 scontext=system_u:system_r:prelink_t:
s0 tcontext=user_u:object_r:user_home_t:s0 tclass=file
May 13 15:55:10 localhost kernel: audit(1179068110.114:13): avc: denied { read } for pid=424
7 comm="prelink" name="lrmzht.msb" dev=dm-0 ino=2720261 scontext=system_u:system_r:prelink_t:s0
tcontext=user_u:object_r:user_home_t:s0 tclass=file
May 13 15:55:10 localhost kernel: audit(1179068110.118:14): avc: denied { read } for pid=424
7 comm="prelink" name="lhtptb.msb" dev=dm-0 ino=2720228 scontext=system_u:system_r:prelink_t:s0
tcontext=user_u:object_r:user_home_t:s0 tclass=file
May 13 15:55:10 localhost kernel: audit(1179068110.118:15): avc: denied { read } for pid=424
7 comm="prelink" name="lpmi.msb" dev=dm-0 ino=2720245 scontext=system_u:system_r:prelink_t:s0 t
context=user_u:object_r:user_home_t:s0 tclass=file
May 13 15:55:10 localhost kernel: audit(1179068110.118:16): avc: denied { read } for pid=424
7 comm="prelink" name="lfid.msb" dev=dm-0 ino=2720212 scontext=system_u:system_r:prelink_t:s0 t
context=user_u:object_r:user_home_t:s0 tclass=file
May 13 15:55:10 localhost kernel: audit(1179068110.118:17): avc: denied { read } for pid=424
7 comm="prelink" name="ltmptb.msb" dev=dm-0 ino=2720278 scontext=system_u:system_r:prelink_t:s0
tcontext=user_u:object_r:user_home_t:s0 tclass=file
May 13 15:55:10 localhost kernel: audit(1179068110.118:18): avc: denied { read } for pid=424
7 comm="prelink" name="lhtko.msb" dev=dm-0 ino=2720227 scontext=system_u:system_r:prelink_t:s0
tcontext=user_u:object_r:user_home_t:s0 tclass=file
May 13 15:55:10 localhost kernel:

paul matthijsse
13th May 2007, 10:10 PM
hello, that command gives way more output than you posted. Try to use the PageUp/PageDown buttons to scroll through it and look for lines that start with ntpd. Another question, why do you want to know the last time internet was accessed? Just curious...

tech291083
13th May 2007, 10:17 PM
hello, that command gives way more output than you posted. Try to use the PageUp/PageDown buttons to scroll through it and look for lines that start with ntpd. Another question, why do you want to know the last time internet was accessed? Just curious...

Thanks, I am an idiot, just trying to learn as much as possible about Linux. I am also teaching a few local friends about the whole Linux idea as well. I keep going through Fedora related question in order to get into it as much as possibly I can. Nothing serious just a learning process..

tech291083
13th May 2007, 10:24 PM
I can't find the line with 'ntpd' even though I tried pageup/down. Any more suggestions. Thanks..

Seve
13th May 2007, 10:30 PM
Hello:
Try

cat /var/log/messages | grep -F ntpd


Seve

tech291083
13th May 2007, 10:45 PM
Hello:
Try

cat /var/log/messages | grep -F ntpd


Seve

Thanks, but even that did not give any result. Then I tried

cat /var/log/messages | grep -i ntpd

cat /var/log/messages | grep -i "ntpd"

but these two also failed, bit confused now what is going wrong here.

tech291083
22nd February 2009, 09:24 AM
[root@localhost ~]# !991
cat /var/log/messages |grep 'ntpd exiting'
Feb 22 13:16:20 localhost ntpd[2085]: ntpd exiting on signal 15
[root@localhost ~]# cat /var/log/messages |grep -i 'ntpd exiting'
Feb 22 13:16:20 localhost ntpd[2085]: ntpd exiting on signal 15
[root@localhost ~]# cat /var/log/messages |grep -F 'ntpd exiting'
Feb 22 13:16:20 localhost ntpd[2085]: ntpd exiting on signal 15


Yes now its working and it looks to me that the time and date here are the indicators of last time when the internet was accessed. Thanks for the patience of all of you here.............