1PMIE_CHECK(1) General Commands Manual PMIE_CHECK(1)
2
3
4
6 pmie_check, pmie_daily - administration of the Performance Co-Pilot
7 inference engine
8
10 $PCP_BINADM_DIR/pmie_check [-NsV] [-c control]
11 $PCP_BINADM_DIR/pmie_daily [-NV] [-c control] [-k discard] [-m
12 addresses] [-x compress] [-X program] [-Y regex]
13
15 This series of shell scripts and associated control files may be used
16 to create a customized regime of administration and management for the
17 Performance Co-Pilot (see PCPintro(1)) inference engine, pmie(1).
18
19 pmie_daily is intended to be run once per day, preferably in the early
20 morning, as soon after midnight as practicable. Its task is to rotate
21 the log files for the running pmie processes - these files may grow
22 without bound if the ``print'' action is used, or any other pme action
23 writes to its stdout/stderr streams. After some period, old pmie log
24 files are discarded. This period is 14 days by default, but may be
25 changed using the -k option. Two special values are recognized for the
26 period (discard), namely 0 to keep no log files beyond the current one,
27 and forever to prevent any log files being discarded.
28
29 Log files can optionally be compressed after some period (compress), to
30 conserve disk space. This is particularly useful for large numbers of
31 pmie processes under the control of pmie_check. The -x option speci‐
32 fies the number of days after which to compress archive data files, and
33 the -X option specifies the program to use for compression - by default
34 this is bzip2(1). Use of the -Y option allows a regular expression to
35 be specified causing files in the set of files matched for compression
36 to be omitted - this allows only the data file to be compressed, and
37 also prevents the program from attempting to compress it more than
38 once. The default regex is ".meta$|.index$|.Z$|.gz$|.bz2|.zip$" - such
39 files are filtered using the -v option to egrep(1).
40
41 Use of the -m option causes pmie_daily to construct a summary of the
42 log files generated for all monitored hosts in the last 24 hours (lines
43 matching `` OK '' are culled), and e-mail that summary to the set of
44 space-separated addresses.
45
46 pmie_check may be run at any time, and is intended to check that the
47 desired set of pmie(1) processes are running, and if not to re-launch
48 any failed inference engines. Use of the -s option provides the
49 reverse functionality, allowing the set of pmie processes to be cleanly
50 shutdown.
51
52 Both pmie_check and pmie_daily are controlled by a PCP inference engine
53 control file that specifies the pmie instances to be managed. The
54 default control file is $PCP_PMIECONTROL_PATH but an alternate may be
55 specified using the -c option.
56
57 The control file should be customized according to the following rules.
58
59 1. Lines beginning with a ``#'' are comments.
60 2. Lines beginning with a ``$'' are assumed to be assignments to
61 environment variables in the style of sh(1), and all text fol‐
62 lowing the ``$'' will be eval'ed by the script reading the con‐
63 trol file, and the corresponding variable exported into the
64 environment. This is particularly useful to set and export
65 variables into the environment of the administrative script,
66 e.g.
67 $ PMCD_CONNECT_TIMEOUT=20
68 Warning: The $PCP_PMIECONTROL_PATH file is a potential security
69 risk if it is writable by any user other than root.
70 3. There should be one line in the control file for each pmie
71 instance of the form:
72
73 host y|n logfile args
74
75 4. Fields within a line of the control file are separated by one or
76 more spaces or tabs.
77 5. The first field is the name of the host that is the default
78 source of the performance metrics for this pmie instance.
79 6. The second field indicates whether this pmie instance needs to
80 be started under the control of pmsocks(1) to connect to a pmcd
81 through a firewall (y or n). Note that pmsocks is part of the
82 pcp product distribution, rather than the pcp_eoe distribution,
83 and as such may not be installed on your system. Refer to
84 PCPintro (1) for full details.
85 8. The third field is the name of the pmie activity log file. A
86 useful convention is that pmie instances monitoring the local
87 host with hostname myhost are maintained in the directory
88 $PCP_LOG_DIR/pmie/myhost, while activity logs for the remote
89 host mumble are maintained in $PCP_LOG_DIR/pmie/mumble. This is
90 consistent with the way pmlogger(1) maintains its activity logs
91 and archive files.
92 9. All other fields are interpreted as arguments to be passed to
93 pmie(1). Most typically this would be the -c option.
94
95 The following sample control lines specify one pmie instance monitoring
96 the local host (wobbly), and another monitoring performance metrics
97 from the host splat.
98
99 wobbly n PCP_LOG_DIR/pmie/wobbly -c pmie/config.default
100 splat n PCP_LOG_DIR/pmie/splat -c pmie/splat/cpu.conf
101
102 A typical crontab(5) entry for periodic execution of pmie_check is
103 given in $PCP_VAR_DIR/config/pmie/crontab and shown below.
104
105 # daily processing of pmie logs
106 14 0 * * * $PCP_BINADM_DIR/pmie_daily
107 # every 30 minutes, check pmie instances are running
108 28,58 * * * * $PCP_BINADM_DIR/pmie_check
109
110 Alternate redirection of the output from the cron(1) execution of the
111 script may be controlled as follows:
112
113 (1) The -V option to the script will enable verbose tracing of their
114 activity. By default the script generates no output unless some
115 error or warning condition is encountered.
116
117 (2) To redirect the e-mail from cron(1) away from the root login,
118
119 + Instead of using the ``root'' login, create a special account
120 with uid equal to 0, e.g. su_pcp. The password may be locked
121 and/or the shell invalid to prevent login or su (1), but the home
122 directory should exist. For example the following entry in
123 /etc/passwd:
124
125 su_pcp:x:0:0:PCP Housekeeping:/usr/people/su_pcp:/dev/null
126
127 + Create a $HOME/.forward for su_pcp, else an entry in
128 /usr/lib/aliases for su_pcp, redirecting the e-mail to a real
129 user or user(s).
130
131 + Add the ``crontab'' entries above to the crontab file for su_pcp
132 not root, e.g. in the file /usr/spool/cron/crontabs/su_pcp
133
134 The -N option enables a ``show me'' mode, where the actions are echoed,
135 but not executed, in the style of ``make -n''. Using -N in conjunction
136 with -V maximizes the diagnostic capabilities for debugging.
137
139 $PCP_PMIECONTROL_PATH
140 the default PCP inference engine control file
141 Warning: this file is a potential security risk if it is
142 writable by any user other than root.
143
144 $PCP_VAR_DIR/config/pmie/crontab
145 sample crontab for automated script execution by root
146
147 $PCP_LOG_DIR/pmie/hostname
148 default location for the pmie log file for the host hostname
149
150 $PCP_LOG_DIR/pmie/hostname/lock
151 transient lock file to guarantee mutual exclusion during pmie
152 administration for the host hostname - if present, can be
153 safely removed if neither pmie_daily nor pmie_check are run‐
154 ning
155
156 $PCP_LOG_DIR/NOTICES
157 PCP ``notices'' file used by pmie(1) and friends
158
160 Environment variables with the prefix PCP_ are used to parameterize the
161 file and directory names used by PCP. On each installation, the file
162 /etc/pcp.conf contains the local values for these variables. The
163 $PCP_CONF variable may be used to specify an alternative configuration
164 file, as described in pcp.conf(4).
165
167 chkconfig(1), cron(1), PCPintro(1), pmie(1) and pmsocks(1).
168
169
170
171Performance Co-Pilot SGI PMIE_CHECK(1)