In this sample example, we monitor and report system and network downages.
The SysDownUrgent script might send an alert message like the following:
-------------------------------------------------------------------------------
PIKT ALERT
Thu Oct 25 23:54:44 2002
vienna
URGENT:
SysDownUrgent
Report systems down or off the network
paris6 is down, or off the network
-------------------------------------------------------------------------------
The script follows.
///////////////////////////////////////////////////////////////////////////////
//
// downage_alarms.cfg
//
///////////////////////////////////////////////////////////////////////////////
[other alarms omitted...]
///////////////////////////////////////////////////////////////////////////////
#if piktmaster
SysDownUrgent
init
status active
level urgent
task "Report systems down or off the network"
input proc "=piktc -L +H all"
dat $host 1
begin
set $timeout = "30" // yes, string var here
rule // report if system doesn't respond to ping
# if linux
if $command("=ping -c 1 $host | =tail -2 | =head -1") =~
" 0% packet loss"
# elif solaris
if $command("=ping $host $timeout") =~ "is alive"
# endif
// do nothing
else
output mail "$host is down, or off the network"
endif
#endif // piktmaster
///////////////////////////////////////////////////////////////////////////////
[other alarms omitted...]
///////////////////////////////////////////////////////////////////////////////
This is just one program example. You could add rules, or write new scripts, for example to: monitor log files for signs of unexpected system reboots, remove /var/crash files, log uptime data, etc.
[For more examples, see Samples.]
Home |
FAQ |
News |
Intro |
Samples |
Tutorial |
Reference |
Software |
Authors |
Licensing |
SiteSearch
Links |
SiteIndex |
Pikt-Users |
Pikt-Workers |
Contribute |
ContactUs |
Top of Page
Page best viewed at 1024x768.
Page last updated 2005-06-22.
This site is
PIKT®
powered.
PIKT® is a registered trademark of the University of Chicago.
Copyright © 1998-2005 Robert Osterlund. All rights reserved.
|