Title: RE: [Perl-unix-users] Help: Daemon Status
apologies, I cut and pasted my code from something I'd already written, and the LOCKFILE bit is irrelevant.
 
Marty
----- Original Message -----
Sent: Monday, November 18, 2002 1:47 PM
Subject: Re: [Perl-unix-users] Help: Daemon Status

Is it a general purpose process, or a custom process, e.g. will any of us here have heard of it.
 
Does this process write log files?
Does it generate SNMP trap messages, Does the process try to communicate with anything else?
 
At the end of the day, if the process in question doesn't have any method of passing on information you will  simply be limited to checking that the process exists and is running (under linux this would be ensuring the process isn't a zombie, and is alive.)
I'm not sure if you can get the parent pid of the process in question, without resorting to using a system command to 'ps' and grepping the parent pid out, maybe someone has written some better methods by now......
 
To check if a process is alive you can use the perl 'kill' command
 
you will first need to capture the pid of the process in question, then :-
 
if (kill 0=> $pid)
{
    #die "process with PID $pid already has a lock on this file $LOCKFILE\n";
}
else
{
    #process is dead
}
----- Original Message -----
Sent: Monday, November 18, 2002 1:18 PM
Subject: RE: [Perl-unix-users] Help: Daemon Status

I am trying to monitor a system process. I do not know where to start.

Ronald Mundell
Nedcor
BG3
881-3751(011)
0834111107


-----Original Message-----
From: $Bill Luebkert [mailto:[EMAIL PROTECTED]]
Sent: 18 November 2002 02:42
To: Mundell, R. (Ronald)
Cc: '[EMAIL PROTECTED]'
Subject: Re: [Perl-unix-users] Help: Daemon Status

Mundell, R. (Ronald) wrote:
> Good Day all
>

>
> I want to monitor a daemon for activity and uptime. I do not know where
> to start. If someone out there knows how to do this and are able to help
> me, it would be greatly appreciated.

Pretty vague requirements.  Something simple would be to have the
daemon write the time to a log file periodically.  Maybe have a
separate pid file with the start time in it or combine the two files.

--
   ,-/-  __      _  _         $Bill Luebkert   ICQ=162126130
  (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
   / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to