Configuration
Configuration
Config Files
Every config file is a sequence of stanzas. A stanza consists of a stanza identifier, in the first column, then the stanza body, either on the same line or in multiple lines following. The stanza body must be indented, using spaces, tabs, or the #indent preprocessor directive.
Almost without exception, and aside from the above simple rules, PIKT is indifferent to script and config file layout. In other words, spacing and line breaks really don't matter, and you may lay out your config files in any style that pleases you.
PIKT comments are like those in C++, that is, // and /* */.
systems.cfg is where you specify host systems, host aliases, and host groups. Here is an example:
/////////////////////////////////// // // PIKT systems configuration file // /////////////////////////////////// solaris hosts moscow athens2 berlin milan london paris paris4 paris5 linux hosts murmansk firenze ... milan aliases bonn rome ... mailserver members moscow paris ...
defines.cfg specifies a set of "defines"--logical switches for including or excluding sections of the config files. Here are some example defines:
debug FALSE verbose FALSE paranoid TRUE
macros.cfg specifies a collection of text substitutions. Macro definitions, but not macro names, may include embedded macros. Some examples:
behead(N) =sed '1,(N)d' offhours ( #hour() >= 18 || \ #hour() < 6 ) sysadmins brahms|albeniz|liszt
In config files, a macro reference is preceded by an equal sign, for example: =behead(1), =offhours, =sysadmins.
Macros may also include macro arguments. As with simple text-substitution macros, macros-with-arguments may reference other macros-with-arguments, so all manner of macro nesting is allowed.
In alerts.cfg, you schedule alarm scripts. Here is an example alerts.cfg stanza:
Urgent timing 0-45/15 * * * * drift 5 priority 10 mailcmd "=mailx -s 'PIKT \ Alert on =host: \ Urgent' =pikturgent" lpcmd "=lp =piktprinter" alarms SysRebootUrgent FsMountsUrgent SwapChkUrgent ...
The timing parameters follow the usual cron conventions and then some. One not so usual timing spec is random timings (for example, 'timing 20% * * * *', which says to run the alert on average every five minutes). The random timing spec is especially useful in security situations, where you want some unpredictability in your monitoring schedules. Still another novel timing spec is "drift"--how many minutes an alert launch may randomly occur before or after a specified time--useful when you don't want alerts to "bunch up."
As alarm scripts are run, their output is queued. At the end of the alert run (an alert is a set of alarms), the queued output may be sent as a single e-mail message to one or more sysadmins, or printed out, using the commands specified.
The alarms.cfg file is a series of Pikt scripts or alarm definitions. For a more detailed discussion of Pikt scripts, see the Scripting Language section below.
In objects.cfg, you specify system objects to be monitored. Object listings can also include data parameters. For example:
UserDirs #if kiev2 /pub/mus_disk_5 /pub/mus_disk_6 #elif kiev0 ... #endif ... SysProcs ... cron : /etc/init.d/cron start ... ...
The file programs.cfg contains support scripts written in other scripting languages, with each program in its own stanza.
In files.cfg, you can centrally manage system configuration files (such as inetd.conf, motd, and so on), and indeed any text file. files.cfg is much like programs.cfg, except that it can and should contain non-program files and/or programs external to the PIKT setup.
Partial Configurations
In a complete PIKT setup, you have all eight basic configuration files. You might, in addition, have #include file spinoffs from those basic eight.
It is possible to deploy PIKT in a partial configuration, with subsets of the eight basic config file types. systems.cfg is always required, but all the rest are optional.
Here are the most common PIKT setups:
- piktc as rsh/ssh replacement (no macros or defines): systems.cfg only
- piktc as rsh/ssh replacement (with macros and possibly defines): systems.cfg, macros.cfg; and optionally defines.cfg
- piktc as rdist replacement: systems.cfg, files.cfg; and optionally programs.cfg, macros.cfg, defines.cfg
- a centrally managed cron replacement: systems.cfg, alerts.cfg, alarms.cfg; and optionally macros.cfg, defines.cfg
- system/network monitor (but without system files management): all config files except files.cfg
- system/network monitor; rsh/ssh, rdist, cron replacements: all config files
So, you may utilize all that PIKT has to offer, or just pick and choose among its many functionalities.
prev page | 1st page | next page |