piktd.conf

(NOTE:  Some of the techniques shown or described on this page--marked in purple--require new features in the latest official PIKT 1.19.0 release (pikt-current.tar.gz) that are unavailable in any previous version.)

Every time the piktd (re)starts, it reads the piktd.conf file in the =piktdir/etc directory.  If it fails to find =piktdir/etc/piktd.conf, it looks for /etc/piktd.conf, then /etc/pikt/piktd.conf, then /usr/local/etc/piktd.conf, and finally /usr/local/etc/pikt/piktd.conf.  If it doesn't find piktd.conf in any of those places, the program will abort.

Here is the format for the piktd.conf file:

<timings> [<drift>] [<nicecmd>] =piktdir/bin/pikt [-T] [+M <mailcmd>] [+L <lpcmd>] +A <alert>
...
For example, a typical piktd.conf file might look something like this:
45 7,15,23 * * 5,6 1 /usr/bin/nice -n 19 /pikt/bin/pikt
  +M "/usr/bin/mailx -s 'PIKT Alert on lyons: Critical' brahms\@hamburg.pikt.org"
  +A Critical
30 7-23/4 * * 0-4 1 /usr/bin/nice -n 19 /pikt/bin/pikt
  +M "/usr/bin/mailx -s 'PIKT Alert on lyons: Urgent' brahms\@hamburg.pikt.org"
  +L "/usr/bin/lp lp" +A Urgent
30 7-23/4 * * 5,6 1 /usr/bin/nice -n 19 /pikt/bin/pikt
  +M "/usr/bin/mailx -s 'PIKT Alert on lyons: Urgent' brahms\@hamburg.pikt.org" 
  +L "/usr/bin/lp lp" +A Urgent
0 7-23 * * 0-4 1 /usr/bin/nice -n 19 /pikt/bin/pikt
  +M "/usr/bin/mailx -s 'PIKT Alert on lyons: EMERGENCY' brahms\@hamburg.pikt.org"
  +L "/usr/bin/lp lp" +A EMERGENCY
...
Although you might edit the piktd.conf directly, under normal operations a 'piktc -e' (enablement) command will do this automatically for you.

'piktc -e' adds lines to piktd.conf, and 'piktc -d' removes them.  For example, 'piktc -ev +A Critical' would add all Critical alert lines, while 'piktc -dv +A Critical' would remove them.  Ordinarily, you would rewrite your entire piktd.conf file with a global enablement:

# piktc -ev +A all +H all

'piktc -T' appends '-T' to any pikt command string that piktc writes to piktd.conf, for example:

0 * * * 0,6 5 /usr/bin/nice -n 19 /pikt/bin/pikt -T
  +M "/bin/mailx -a 'From: piktadmin' -s 'PIKT Alert on cologne: EMERGENCY' biber\@pikt.org"
  +L "/usr/bin/lp lp" +A EMERGENCYTest
piktd ignores lines beginning with the comment character '#'.  ('piktc -e' would never add commented-out lines; only a manual edit of piktd.conf would do this.)

prev page 1st page next page
 
Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software
Developer's Notes | Licensing | Authors | Pikt-Users | Pikt-Workers | Related Projects | Site Index | Privacy Policy | Contact Us
Page best viewed at 1024x768 or greater.   Page last updated 2019-01-12.   This site is PIKT® powered.
Copyright © 1998-2019 Robert Osterlund. All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title
Learn about
Error &
Info Logging