LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-01-2014, 02:33 PM   #1
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 593

Rep: Reputation: 59
Logs for Services Killed or Stopped


Is there a way to see the logs of services as to when they were stopped or their PIDs were killed?


For example,

Nagios is alerting:

Code:
PROCS CRITICAL: 0 processes with command name 'nsca'
I see on the server:
Code:
# /etc/init.d/nsca status
nsca dead but pid file exists
The PID file is here:

Code:
# ls -l nsca.pid
-rw-r--r-- 1 nagios nagios 6 Jun 13 07:26 nsca.pid

# cat nsca.pid
32533


# ps up 32533
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND


# grep 32533 /var/log/messages
#
So, I can see the process was started on 6th June but can't determine when it was stopped / killed.
 
Old 09-02-2014, 08:46 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,468
Blog Entries: 15

Rep: Reputation: 1452Reputation: 1452Reputation: 1452Reputation: 1452Reputation: 1452Reputation: 1452Reputation: 1452Reputation: 1452Reputation: 1452Reputation: 1452
You could look through the system logs of the client (e.g. /var/log/messages).

Also the Nagios master keeps logs of when it sees events. You can step back through the logs in the web GUI (i.e. select the service that is alerting then select the option for view history for this service) by day. Alternatively you can grep for what you want in the logs which are generally in /var/log/nagios (and /var/log/nagios/archive) on the master server to get the first time it alerted. You may have to convert the time entry seen from epoch to human readable. You can do that with:

perl -e 'print scalar localtime <epoch>;print "\n"'
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Can these services be killed? battles Linux - Software 8 05-08-2014 12:21 PM
Port based services stopped working InventiousTech Linux - Networking 1 10-10-2013 03:40 PM
stopped processes - finding out who/what killed them? simulator Linux - Newbie 11 03-30-2012 01:09 AM
LXer: Linux automatically monitor and restart services when daemon is killed LXer Syndicated Linux News 0 11-25-2006 10:21 PM
webalizer - stopped updating my logs nickd63 Linux - Networking 1 12-13-2004 09:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration