Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
bind named uptime?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Fenixoid
Apprentice
Apprentice


Joined: 09 Dec 2004
Posts: 154
Location: Lithuania

PostPosted: Mon Dec 11, 2006 4:39 pm    Post subject: bind named uptime? Reply with quote

Hi,

is the a way to view named service uptime?
_________________
gentoo.lt
p.s. my english sucks ;-)
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Mon Dec 11, 2006 5:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
Fenixoid
Apprentice
Apprentice


Joined: 09 Dec 2004
Posts: 154
Location: Lithuania

PostPosted: Mon Dec 11, 2006 6:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Mon Dec 11, 2006 6:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
Fenixoid
Apprentice
Apprentice


Joined: 09 Dec 2004
Posts: 154
Location: Lithuania

PostPosted: Mon Dec 11, 2006 6:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Mon Dec 11, 2006 7:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
Fenixoid
Apprentice
Apprentice


Joined: 09 Dec 2004
Posts: 154
Location: Lithuania

PostPosted: Tue Dec 12, 2006 10:28 am    Post subject: Reply with quote

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
View user's profile Send private message
nobspangle
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1318
Location: Manchester, UK

PostPosted: Tue Dec 12, 2006 8:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Tue Dec 12, 2006 8:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Wed Dec 13, 2006 3:30 am    Post subject: Reply with quote

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
View user's profile Send private message
Fenixoid
Apprentice
Apprentice


Joined: 09 Dec 2004
Posts: 154
Location: Lithuania

PostPosted: Wed Dec 13, 2006 9:55 am    Post subject: Reply with quote

Now I see some solutions 8)

Thank you all.
_________________
gentoo.lt
p.s. my english sucks ;-)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum