systems.cfg
systems.cfg is where you specify computer system hostnames, aliases, and groups. The top-level systems.cfg file might reference smaller #include files, some of them perhaps auto-generated.
You use these systems specifications together with the '#if <machine class>' preprocessor directive to customize your PIKT configurations on a per-machine(s) basis and/or by operating system.
This is a rather elaborate example systems.cfg file, with many different host groups and aliases and auto-generated #include files. Especially for smaller organizations, a typical systems.cfg might be much simpler than this.
/////////////////////////////////////////////////////////////////////////////// // // PIKT systems.cfg -- host systems, aliases, and groups // /////////////////////////////////////////////////////////////////////////////// // // since #if-#endif's reference system names, this file cannot contain // any #if-#endif's, since the system names are still in the process of // specification! (neither can this file contain #ifdef's or any of the // other #-style preprocessor directives, except for #include; it can // contain comments, though and obviously) // /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // hosts, grouped by Unix or Linux operating system or operating system // version /////////////////////////////////////////////////////////////////////////////// solaris hosts vienna nantes berlin berlin2 warsaw moscow athens2 athens4 milan calais calais2 brussels copenhagen madrid kiev kiev2 paris paris4 paris5 paris6 paris7 paris8 hamburg cadiz trondheim rotterdam cologne naples leiden ankara minsk uppsala padua bucharest sheffield /////////////////////////////////////////////////////////////////////////////// // for linux, here is alternative way of registering hosts; here we // subcategorize by os version, then in the hostgroups section below we // aggregate the os subcategories into one big os host group (see the // linux host groups below); doing it this way helps ensure that each // host gets subcategorized; it also involves less typing overall redhat hosts manila davao dumaguete suse hosts vancouver toronto montreal calgary winnipeg ottawa debian hosts firenze murmansk /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // host aliases vienna aliases piktmaster // note: although =piktmaster is a // predefined macro, the piktmaster // alias here is needed if you want // to use '#if piktmaster' later // on in the configuration files vienna.uppity.edu piktdevsys kiev aliases antwerp milan aliases bonn rome madrid aliases madrid2 nantes aliases nismaster ypmaster paris aliases paris3 moscow aliases mailmanserver // d153-82.twilight.zone.net // aliases davao // d153-241.twilight.zone.net // aliases manila /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // host groups /////////////////////////////////////////////////////////////////////////////// // since we reference down in many of the '#verbatim [<proc>] directives // that follow, we want to specify down as early in systems.cfg as // possible so that subsequent references are most up-to-date down // set '-H down' for these members // note: systems specially listed here must also be specially // listed in the =down specification in macros.cfg rotterdam padua #verbatim <systems/down_systems.cfg> [/pikt/lib/programs/downsys.pl 10] /////////////////////////////////////////////////////////////////////////////// // linux hostgroups linux members redhat suse debian /////////////////////////////////////////////////////////////////////////////// // sun arch groups sun4d members #verbatim <systems/sun4d_systems.cfg> [/pikt/bin/piktc -xI +C "=uname -a | =egrep -i sun4d >/dev/null && =hostname" +H solaris -H down 2>/dev/null] sun4m members #verbatim <systems/sun4m_systems.cfg> [/pikt/bin/piktc -xI +C "=uname -a | =egrep -i sun4m >/dev/null && =hostname" +H solaris -H down 2>/dev/null] sun4u members #verbatim <systems/sun4u_systems.cfg> [/pikt/bin/piktc -xI +C "=uname -a | =egrep -i sun4u >/dev/null && =hostname" +H solaris -H down 2>/dev/null] /////////////////////////////////////////////////////////////////////////////// // administrative-class hostgroups itsys members vienna nantes berlin berlin2 warsaw moscow athens2 athens4 milan calais calais2 brussels copenhagen madrid kiev kiev2 paris paris4 paris5 paris6 paris7 paris8 hamburg cadiz trondheim rotterdam cologne murmansk firenze manila davao dumaguete suse mussys members nonitsys pvtsys // private systems members manila davao dumaguete /////////////////////////////////////////////////////////////////////////////// // shared-systems hostgroups mus members #verbatim <systems/mus_systems.cfg> [/pikt/bin/piktc -xI +C "=hostname | =grep kiev" -H down 2>/dev/null] perf members #verbatim <systems/perf_systems.cfg> [/pikt/bin/piktc -xI +C "=hostname | =grep paris" -H down 2>/dev/null] comp members milan #verbatim <systems/comp_systems.cfg> [/pikt/bin/piktc -xI +C "=hostname | =grep madrid" -H down 2>/dev/null] /////////////////////////////////////////////////////////////////////////////// // it hostgroups missioncritical // mission-critical systems members #include <systems/missioncritical_systems.cfg> adminsys // administrative, non-user systems members vienna nantes berlin berlin2 moscow athens2 athens4 calais calais2 brussels copenhagen cologne systems // sysadmin systems members hamburg cadiz trondheim db // database systems members athens2 athens4 milan usersys // in effect an alias for sunsuser members berlin berlin2 moscow madrid perf mus backupclient members solaris linux /////////////////////////////////////////////////////////////////////////////// // server hostgroups mailserver members moscow paris // kiev appserver members berlin2 // berlin printserver members helsinki copenhagen backupserver members calais brussels // calais2 webserver members #verbatim <systems/webserver_systems.cfg> [/pikt/bin/piktc -xI +C "=psall | =grep http | =egrep -v 'piktc|grep|ab2|-http' >/dev/null && =hostname" +H solaris -H down 2>/dev/null] dnsserver members calgary ottawa dnsmaster members calgary dnsslave members ottawa /////////////////////////////////////////////////////////////////////////////// // nis hostgroups nisserver members #include <systems/nisserver_systems.cfg> nisclient members solaris /////////////////////////////////////////////////////////////////////////////// // nfs hostgroups nfsserver members #verbatim <systems/nfsserver_systems.cfg> [/pikt/bin/piktc -xI +C "=showmount -e | =egrep -ivs 'rpc: program not registered|no exported file systems' >/dev/null && =hostname" +H solaris -H down 2>/dev/null] nfsclient members solaris no_usr_local // no NFS crossmounted /usr/local on these machines members linux #verbatim <systems/no_usr_local_systems.cfg> [/pikt/bin/piktc -xI +C "=lld /usr/local/etc/tmp 2>&1 | =grep -i 'no such' >/dev/null && =hostname" +H solaris -H down] usr_local members nonno_usr_local no_opt_local // no NFS crossmounted /opt/local on these machines members linux opt_local members nonno_opt_local /////////////////////////////////////////////////////////////////////////////// // network hostgroups local // sharing the same network segment with the piktmaster members #verbatim <systems/local_systems.cfg> [/pikt/bin/piktc -xI +C "=ifconfig -a | =grep 123.111.130 >/dev/null && =hostname" -H down 2>/dev/null] baksubnet // sharing the machine room bak subnet members #verbatim <systems/baksubnet_systems.cfg> [/pikt/bin/piktc -xI +C "=ifconfig -a | =grep 192.168.0 >/dev/null && =hostname" -H down 2>/dev/null] /////////////////////////////////////////////////////////////////////////////// // special-function hostgroups nosendmail members kiev kiev2 athens2 athens4 warsaw vienna berlin berlin2 nantes milan brussels madrid paris4 paris5 paris6 paris7 paris8 calais2 // calais murmansk firenze cologne leiden copenhagen calais crem members madrid kiev kiev2 paris4 paris5 paris6 paris7 paris8 naples // kiev3 kbt members // empty /////////////////////////////////////////////////////////////////////////////// // files and/or process management hostgroups sudo members #verbatim <systems/sudo_systems.cfg> [/pikt/bin/piktc -xI +C "=ls /etc/sudoers 2>/dev/null | =grep sudoers >/dev/null && =hostname" -H down 2>/dev/null] tcpd members firenze #verbatim <systems/tcpd_systems.cfg> [/pikt/bin/piktc -xI +C "=grep tcpd /etc/inetd.conf | =grep -v '^#'>/dev/null && =hostname" -H down 2>/dev/null] ntpd members #verbatim <systems/ntpd_systems.cfg> [/pikt/bin/piktc -xI +C "=psall | =grep ntpd | =egrep -v ' piktc|grep' >/dev/null && =ls /etc/ntp.conf 2>&1 | =grep -iv 'no such' >/dev/null && =hostname" -H down 2>/dev/null] /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // pikt admin hostgroups /////////////////////////////////////////////////////////////////////////////// newsys // set '-D doexec +D verbose' for these (or just // set these in defines.cfg accordingly) members davao //cadiz trondheim //firenze /////////////////////////////////////////////////////////////////////////////// testsys // set '+D debug' for these (or just // set this in defines.cfg accordingly) members davao // piktmaster /////////////////////////////////////////////////////////////////////////////// sick // set '-H sick' for these members #verbatim <systems/sick_systems.cfg> ///////////////////////////////////////////////////////////////////////////////
(A note about page layout: In the interest of readability, we have added artificial line wraps in many examples. Even though displayed here broken up across several screen lines, in general quoted strings, preprocessor directives, macro definitions, .log & .conf entries, and so on should all be unbroken on a single line.)
For more examples, see Samples.