NAME

pidstat - Check the existence of a process on a remote machine

SYNOPSIS

pidstat [ --help ] [ --host=host ] [ --port=port ] [ --silent ] [ --version ] [ --debug ] [ exists remotepids ]

DESCRIPTION

Pidstat will contact the PID stat daemon (pidstatd, in the IPC::Locker distribution on CPAN) and perform the requested command(s).

COMMANDS

exists remotepids

Check the existence of a set of process IDs (potentially) on remote hosts.

Takes a list of remote process IDs. These process IDs are understood to be on the host specified by "--host" (default is "localhost"). Alternatively, the host may be overridden by specifying the process IDs in the form <hostname>:<pid>.

The exit value is 0 if all the requested process IDs exist. The exit value is 1 if any of the requested process IDs did not exist, or 2 if any hosts did not have a running daemon. This is roughly the same as "kill -0 <pid>".

The following works well for shell scripts.

if pidstat exists 3459 host1:4220 host2:9821
then
   print "All processes are up"
else
   print "One of the processes is down"
fi

ARGUMENTS

--help

Displays this message and program version and exits.

--host

Specifies host name to check for a process.

--port

Specifies the port number to contact the "pidstatd" on. (default 1752)

--silent

Do not print out a line per process checked.

--debug

Turns on the debug flag for diagnostic output.

--version

Displays program version and exits.

DISTRIBUTION

The latest version is available from CPAN and from https://www.veripool.org/ipc-locker.

Copyright 2002-2022 by Wilson Snyder. This package is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0.

AUTHORS

Wilson Snyder <wsnyder@wsnyder.org>, Stephen Adkins <stephen.adkins@officevision.com>

SEE ALSO

IPC::Locker, IPC::PidStat, pidstatd, pidwatch, uriexec