View previous topic :: View next topic |
Author |
Message |
Fenixoid Apprentice

Joined: 09 Dec 2004 Posts: 154 Location: Lithuania
|
Posted: Mon Dec 11, 2006 4:39 pm Post subject: bind named uptime? |
|
|
Hi,
is the a way to view named service uptime? _________________ gentoo.lt
p.s. my english sucks  |
|
Back to top |
|
 |
erik258 Advocate


Joined: 12 Apr 2005 Posts: 2650 Location: Twin Cities, Minnesota, USA
|
Posted: Mon Dec 11, 2006 5:24 pm Post subject: |
|
|
named's uptime?
you mean the amount of time it runs? or do you have it in xinetd? _________________ Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit! |
|
Back to top |
|
 |
Fenixoid Apprentice

Joined: 09 Dec 2004 Posts: 154 Location: Lithuania
|
Posted: Mon Dec 11, 2006 6:00 pm Post subject: |
|
|
erik258 wrote: | you mean the amount of time it runs? |
Yes. Like system, mysql has it's uptime, so maby named has also? _________________ gentoo.lt
p.s. my english sucks  |
|
Back to top |
|
 |
erik258 Advocate


Joined: 12 Apr 2005 Posts: 2650 Location: Twin Cities, Minnesota, USA
|
Posted: Mon Dec 11, 2006 6:24 pm Post subject: |
|
|
ps -fC named will show you how much time it's been running... _________________ Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit! |
|
Back to top |
|
 |
Fenixoid Apprentice

Joined: 09 Dec 2004 Posts: 154 Location: Lithuania
|
Posted: Mon Dec 11, 2006 6:51 pm Post subject: |
|
|
Code: | box ~ # ps -fC named
UID PID PPID C STIME TTY TIME CMD
named 4354 1 0 Dec09 ? 00:00:00 /usr/sbin/named -u named -n 1 |
00:00:00 ? False. _________________ gentoo.lt
p.s. my english sucks  |
|
Back to top |
|
 |
erik258 Advocate


Joined: 12 Apr 2005 Posts: 2650 Location: Twin Cities, Minnesota, USA
|
Posted: Mon Dec 11, 2006 7:04 pm Post subject: |
|
|
i guess it doesn't do too much on your system ; ) (by which i mean, named is asleep most of the time)
i'm looking for some info on this, just for fun. but i was wondering, do you want to see how long the process has been around? or do you want to see how often it is actually running, like uptime's 'load average' informaton?
still looking for a way to find out when the process was started. you might need profiling for this ... or you could check your logs, my bet is named says something when it starts... _________________ Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit! |
|
Back to top |
|
 |
Fenixoid Apprentice

Joined: 09 Dec 2004 Posts: 154 Location: Lithuania
|
Posted: Tue Dec 12, 2006 10:28 am Post subject: |
|
|
Well i need some command line stuff to show how long names is running. e.g. is it runs for 4 days or 10 days.
The idea when he was last startes fro /etc/init.d/named is also acceptable. _________________ gentoo.lt
p.s. my english sucks  |
|
Back to top |
|
 |
nobspangle Veteran


Joined: 23 Mar 2004 Posts: 1318 Location: Manchester, UK
|
Posted: Tue Dec 12, 2006 8:19 pm Post subject: |
|
|
I do
Code: | ps aux | grep named
named 4812 0.0 0.6 5932 3368 ? Ss Dec03 0:08 /usr/sbin/named -u named -n 1 |
I can see that named was started on December 3rd |
|
Back to top |
|
 |
erik258 Advocate


Joined: 12 Apr 2005 Posts: 2650 Location: Twin Cities, Minnesota, USA
|
Posted: Tue Dec 12, 2006 8:33 pm Post subject: |
|
|
there you go, now you can just take the SleepAVG line from /proc/${PID}/status and you have all the info you want! _________________ Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit! |
|
Back to top |
|
 |
pteppic l33t

Joined: 28 Nov 2005 Posts: 781
|
Posted: Wed Dec 13, 2006 3:30 am Post subject: |
|
|
named.uptime.sh
Code: | #!/bin/bash
start=$(date +%s -r /var/run/named/named.pid)
now=$(date +%s)
time=$(( now - start ))
days=$(( time / 86400 ))
time=$(( time - $(( days * 86400 )) ))
hours=$(( time / 3600 ))
time=$(( time - $(( hours * 3600 )) ))
minutes=$(( time / 60 ))
time=$(( time - $(( minutes * 60 )) ))
echo $days Days $hours Hours $minutes Minutes $time Seconds
|
|
|
Back to top |
|
 |
Fenixoid Apprentice

Joined: 09 Dec 2004 Posts: 154 Location: Lithuania
|
Posted: Wed Dec 13, 2006 9:55 am Post subject: |
|
|
Now I see some solutions
Thank you all. _________________ gentoo.lt
p.s. my english sucks  |
|
Back to top |
|
 |
|