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 [-CNsTV?] [-c control] [-l logfile]
11 $PCP_BINADM_DIR/pmie_daily [-NV?] [-c control] [-k discard] [-l log‐
12 file] [-m 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 pmie 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/--discard option. Two special values are recog‐
26 nized for the period (discard), namely 0 to keep no log files beyond
27 the current one, 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/--com‐
32 press-after option specifies the number of days after which to compress
33 archive data files, and the -X option specifies the program to use for
34 compression - by default this is xz(1). Use of the -Y/--regex option
35 allows a regular expression to be specified causing files in the set of
36 files matched for compression to be omitted - this allows only the data
37 file to be compressed, and also prevents the program from attempting to
38 compress it more than once. The default regex is
39 ".(meta|index|Z|gz|bz2|zip|xz|lzma|lzo|lz4)$" - such files are filtered
40 using the -v option to egrep(1).
41
42 Use of the -m/--mail option causes pmie_daily to construct a summary of
43 the log files generated for all monitored hosts in the last 24 hours
44 (lines matching `` OK '' are culled), and e-mail that summary to the
45 set of space-separated addresses.
46
47 pmie_check may be run at any time, and is intended to check that the
48 desired set of pmie(1) processes are running, and if not to re-launch
49 any failed inference engines. Use of the -s/--stop option provides the
50 reverse functionality, allowing the set of pmie processes to be cleanly
51 shutdown. Use of the -C option queries the system service runlevel
52 information for pmie, and uses that to determine whether to start pro‐
53 cesses.
54
55 Both pmie_check and pmie_daily are controlled by PCP inference engine
56 control file(s) that specify the pmie instances to be managed. The
57 default control file is $PCP_PMIECONTROL_PATH but an alternate may be
58 specified using the -c/--control option. If the directory $PCP_PMLOG‐
59 GERCONTROL_PATH.d (or control.d from the -c/--control option) exists,
60 then the contents of any additional control files therein will be
61 appended to the main control file (which must exist).
62
63 Warning: The $PCP_PMIECONTROL_PATH and $PCP_PMIECONTROL_PATH.d files
64 must not be writable by any user other than root.
65
66 The control file(s) should be customized according to the following
67 rules that define for the current version (1.1) of the control file
68 format.
69
70 1. Lines beginning with a ``#'' are comments.
71 2. Lines beginning with a ``$'' are assumed to be assignments to envi‐
72 ronment variables in the style of sh(1), and all text following the
73 ``$'' will be eval'ed by the script reading the control file, and
74 the corresponding variable exported into the environment. This is
75 particularly useful to set and export variables into the environ‐
76 ment of the administrative script, e.g.
77 $ PMCD_CONNECT_TIMEOUT=20
78 3. There must be a version line in the initial control file of the
79 form:
80 $ version=1.1
81 4. There should be one line in the control file(s) for each pmie
82 instance of the form:
83
84 host y|n y|n logfile args
85
86 5. Fields within a line of the control file(s) are separated by one or
87 more spaces or tabs.
88 6. The first field is the name of the host that is the default source
89 of the performance metrics for this pmie instance.
90 7. The second field indicates if this is a primary pmie instance (y)
91 or not (n). Since the primary inference engine must run on the
92 local host, and there may be at most one primary for a particular
93 host, this field can be y for at most one pmie instance, in which
94 case the host name must be the name of the local host. When gener‐
95 ating pmie configuration files, the primary clause indicates that
96 pmieconf(1) should enable all rules in the primary group, in addi‐
97 tion to all other default rules.
98 8. The third field indicates whether this pmie instance needs to be
99 started under the control of pmsocks(1) to connect to a pmcd
100 through a firewall (y or n).
101 9. The fourth field is the name of the pmie activity log file. A use‐
102 ful convention is that pmie instances monitoring the local host
103 with hostname myhost are maintained in the directory
104 $PCP_LOG_DIR/pmie/myhost, while activity logs for the remote host
105 mumble are maintained in $PCP_LOG_DIR/pmie/mumble. This is consis‐
106 tent with the way pmlogger(1) maintains its activity logs and ar‐
107 chive files.
108 10. All other fields are interpreted as arguments to be passed to
109 pmie(1). Most typically this would be the -c option.
110
111 The following sample control lines specify one pmie instance monitoring
112 the local host (wobbly), and another monitoring performance metrics
113 from the host splat.
114
115 wobbly n PCP_LOG_DIR/pmie/wobbly -c config.default
116 splat n PCP_LOG_DIR/pmie/splat -c splat/cpu.conf
117
118 Typical crontab(5) entries for periodic execution of pmie_daily and
119 pmie_check are given in $PCP_SYSCONF_DIR/pmie/crontab (unless installed
120 by default in /etc/cron.d already) and shown below.
121
122 # daily processing of pmie logs
123 08 0 * * * $PCP_BINADM_DIR/pmie_daily
124 # every 30 minutes, check pmie instances are running
125 28,58 * * * * $PCP_BINADM_DIR/pmie_check
126
127 In order to ensure that mail is not unintentionally sent when these
128 scripts are run from cron(8) diagnostics are always sent to log files.
129 By default, these files are $PCP_LOG_DIR/pmie/pmie_daily.log and
130 $PCP_LOG_DIR/pmie/pmie_check.log but this can be changed using the -l
131 option. If this log file already exists when the script starts, it
132 will be renamed with a .prev suffix (overwriting any log file saved
133 earlier) before diagnostics are generated to the new log file.
134
135 The output from the cron execution of the scripts may be extended using
136 the -V/--verbose option to the scripts which will enable verbose trac‐
137 ing of their activity. By default the scripts generate no output
138 unless some error or warning condition is encountered.
139
140 The -N/--showme option enables a ``show me'' mode, where the actions
141 are echoed, but not executed, in the style of ``make -n''. Using -N in
142 conjunction with -V/--verbose maximizes the diagnostic capabilities for
143 debugging.
144
146 $PCP_PMIECONTROL_PATH
147 the default PCP inference engine control file
148 Warning: this file must not be writable by any user other
149 than root.
150
151 $PCP_PMIECONTROL_PATH.d
152 optional directory containing additional PCP inference engine
153 control files, typically one per host
154 Warning: this files herein must not be writable by any user
155 other than root.
156
157 $PCP_SYSCONF_DIR/pmie/crontab
158 sample crontab for automated script execution by $PCP_USER
159 (or root) - exists only if the platform does not support the
160 /etc/cron.d mechanism.
161
162 $PCP_VAR_DIR/config/pmie/config.default
163 default pmlogger configuration file location for a localhost
164 inference engine, typically generated automatically by
165 pmieconf(1).
166
167 $PCP_LOG_DIR/pmie/hostname
168 default location for the pmie log file for the host hostname
169
170 $PCP_LOG_DIR/pmie/hostname/lock
171 transient lock file to guarantee mutual exclusion during pmie
172 administration for the host hostname - if present, can be
173 safely removed if neither pmie_daily nor pmie_check are run‐
174 ning
175
176 $PCP_LOG_DIR/NOTICES
177 PCP ``notices'' file used by pmie(1) and friends
178
180 Environment variables with the prefix PCP_ are used to parameterize the
181 file and directory names used by PCP. On each installation, the file
182 /etc/pcp.conf contains the local values for these variables. The
183 $PCP_CONF variable may be used to specify an alternative configuration
184 file, as described in pcp.conf(5).
185
187 egrep(1), PCPintro(1), pmie(1), pmieconf(1), xz(1) and cron(8).
188
189
190
191Performance Co-Pilot PCP PMIE_CHECK(1)