Error & Info Logging

In general, PIKT logs daemon (piktc_svc and piktd) starts and stops, and other daemon failures to the appropriate log file (piktc_svc.log and piktd.log, both in =piktdir/var/log).

With piktc, most errors are reported to the command line, but sometimes additional, technical information is logged to its log file (piktc.log).

Every time piktc sends a service request to a client system, this is logged in the =piktdir/var/log/piktc.log file.  Likewise, piktc_svc logs, to =piktdir/var/log/piktc_svc.log, every service request it receives.  If piktc_svc receives a request from an unauthorized account or system, it flags this as an "ERROR".  You can use other log file monitoring Pikt scripts to alert you to this possible security violation.  You can also have scripts to analyze and compare the piktc.log and various piktc_svc.log files to verify the validity of service requests.

Every time piktd launches a Pikt script, it logs the invoking command in =piktdir/var/log/piktd.log.

As for pikt, each alert is assigned its own log file.  For example, the Urgent alert's log file is Urgent.log (also found in =piktdir/var/log).  In alert log files, the following things are logged:

  • alert run startups and normal/abnormal terminations
  • errors (marked by "ERROR"), whenever a serious error is detected (e.g., attempted divide by zero, or the appearance of a negative array index); depending on the seriousness of the error, the pikt run may or may not abort prematurely
  • warnings (marked by "WARNING"), whenever a possible error condition is detected (e.g., whenever interpreting a number as a string, or when a file is not found); warnings never lead to premature aborts
  • external command invocations (e.g., for every "exec" statement, or whenever #system() or $command() are invoked); the idea here is to log each time PIKT reaches out to impact on the external environment, useful for later debugging
  • anything that an exec'ed statement, $command() call or #system() call outputs to stderr; this is useful for determining why a script mysteriously fails; such log entries are not date/time-stamped--you can use this fact within log monitoring scripts to identify such entries and thus report stderr dumps
Every log entry is stamped with the current date and time, the system name, the PIKT program generating the log entry, its process id, a numerical error id, and an error level.  For some log entries, the source file, the line number in that source file, and the function where the logging occurred might also be shown.  Here is a typical log entry:
Oct 14 09:37:25 vienna pikt[24009]: [ID 7501 WARNING] in
  SysBakSubnetDownEmergency, resolving number 30.000000 as string 30
Alert logs can grow quickly in size, if a script is run often enough, if it analyzes lots of data, and if it produces many warnings (through, e.g., repeated number-to-string conversions).  You should seriously consider putting in place PIKT alarms to monitor your alert (and other) logs, truncating and/or compressing-and-archiving them when they reach a certain size.  (See the examples.)  You should also set 'verbose_log' to 'no' in PIKT.conf, except when debugging.

(When run in debug (-G) mode, PIKT binaries error and info log to stderr.)

If auto_syslog is set to 'yes' in PIKT.conf, in addition to the logging described above, all program outputs (for example, from Pikt 'output', 'output mail', etc.) are sent to syslog at facility local0.  You can, using the syslog_facility parameter, set this to any of local0 through local7 instead.

This automatic routing of all program outputs to syslog is especially useful if you have configured syslog (via the appropriate syslog.conf settings) to send along all messages to a central loghost.  You might do this to archive all PIKT messages, or to process them all at one point for purposes of graphical display.  You might also find it useful to send all EMERG-level messages to all root logins, for example.

prev page 1st page next page
Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software | DevNotes | Licensing | Authors | Pikt-Users | Pikt-Workers | Links | SiteIndex | ContactUs
Page best viewed at 1024x768.   Page last updated 2006-09-10.   This site is PIKT® powered.
PIKT® is a registered trademark of the University of Chicago.   Copyright © 1998-2006 Robert Osterlund.  All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title