PMDAOPENLOG(3) Library Functions Manual PMDAOPENLOG(3)NAME
pmdaOpenLog - redirect stderr to a logfile
C SYNOPSIS
#include <pcp/pmapi.h>
#include <pcp/impl.h>
#include <pcp/pmda.h>
void pmdaOpenLog(pmdaInterface * dispatch);
cc ... -lpcp_pmda -lpcp
DESCRIPTION
pmdaOpenLog redirects stderr to the logfile specified in the dispatch structure, set by the previous call to pmdaDaemon(3) or pmdaGe-
tOpt(3). The first line of the log file will detail the name of the calling process, the host the process is running on, and the current
time. In addition, the log is appended with the exit time of the process by a routine registered with atexit(3C).
CAVEAT
The PMDA must be using PMDA_PROTOCOL_2 or later, as specified in the call to pmdaDSO(3) or pmdaDaemon(3).
PCP ENVIRONMENT
Environment variables with the prefix PCP_ are used to parameterize the file and directory names used by PCP. On each installation, the
file /etc/pcp.conf contains the local values for these variables. The $PCP_CONF variable may be used to specify an alternative configura-
tion file, as described in pcp.conf(5). Values for these variables may be obtained programmatically using the pmGetConfig(3) function.
SEE ALSO pmcd(1), atexit(2), PMAPI(3), PMDA(3), pmdaDaemon(3) and pmdaGetOpt(3).
Performance Co-Pilot PCP PMDAOPENLOG(3)
Check Out this Related Man Page
PMGETCONTEXTHOSTNAME(3) Library Functions Manual PMGETCONTEXTHOSTNAME(3)NAME
pmGetContextHostName - return the hostname associated with a Performance Co-Pilot context
C SYNOPSIS
#include <pcp/pmapi.h>
const char *pmGetContextHostName(int id);
cc ... -lpcp
DESCRIPTION
Given a valid PCP context identifier previously created with pmNewContext(3) or pmDupContext(3), the pmGetContextHostName function returns
the hostname associated with id.
If the context id is associated with an archive source of data, the hostname returned is extracted from the archive label using
pmGetArchiveLabel(3).
For live contexts, an attempt will first be made to retrieve the hostname from the PCP collector system using pmFetch(3) with the
pmcd.hostname metric. This allows client tools using this interface to retrieve an accurate host identifier even in the presence of port
forwarding and tunnelled connections.
Should this not succeed, then a fallback method is used. For local contexts - with local meaning any of DSO, ``localhost'' or Unix domain
socket connection - a hostname will be sought via gethostname(3). For other contexts, the hostname extracted from the initial context host
specification will be used.
RETURN VALUE
If id is not a valid PCP context identifier, this function returns a zero length string and hence never fails.
PCP ENVIRONMENT
Environment variables with the prefix PCP_ are used to parameterize the file and directory names used by PCP. On each installation, the
file /etc/pcp.conf contains the local values for these variables. The $PCP_CONF variable may be used to specify an alternative configura-
tion file, as described in pcp.conf(5). Values for these variables may be obtained programmatically using the pmGetConfig(3) function.
SEE ALSO PCPIntro(1), PMAPI(3), gethostname(3), pmDupContext(3), pmFetch(3), pmGetArchiveLabel(3), pmNewContext(3), pcp.conf(5) and pcp.env(5).
Performance Co-Pilot PCP PMGETCONTEXTHOSTNAME(3)
Hi Sir's
I've the below piece of code has the following functionalities:
1) Read the "pcp" file and create Job related parameter file "$PARMFILE".
$PARMFILE has below variables:
AFTD2010 "FILE_TYPE_D=Y export FILE_TYPE_D"
AFTD2010 "FILE_TYPE_I=N export FILE_TYPE_I"
AFTD2010... (0 Replies)
I'm using below command to redirect stderr to a file but I also want to add timestamp to stderr.out to find out the date / time the error occurred.
ls -ltr 2>>/tmp/stderr.out
Thanks (5 Replies)
Hi there,
I was wondering if it was possible to pipe stderr to another process.
I need to eval commands given as arguments and I would like to redirect stderr to another process.
I can redirect stderr to a file like this...
toto:~$ command="one=1"
toto:~$ eval $command 2> error
toto:~$... (5 Replies)
$ a=$(<missing)
-bash: missing: No such file or directory
$ a=$(<missing) 2> /dev/null
-bash: missing: No such file or directory
$ a=$(<missing 2> /dev/null)
-bash: missing: No such file or directory
$ a=$( { <missing 2> /dev/null; } )
-bash: missing: No such file or directory
$... (10 Replies)