PIKT

Samples: Pwck Problems

PIKT Logo
Home FAQ News Intro Samples Tutorial Reference Software Authors Licensing SiteSearch


In this example, we report passwd and shadow file problems as found by the standard pwck program.  Although you might use other means to monitor and report problems with /etc/passwd and /etc/shadow--for example, utilize the Pikt script PasswdFileProblemsUrgent--you might also want to consult pwck for added reassurance.

The PwckWarning script might send an alert message like the following:

-------------------------------------------------------------------------------

                                PIKT ALERT
                         Mon Oct 20 02:49:19 2003
                                  ankara

WARNING:
    PwckWarning
        Report /etc/passwd & /etc/shadow file problems as found by pwck

        no matching password file entry
        delete line `staff:!:12515:0:99999:7:::'? No

-------------------------------------------------------------------------------
The script follows.

///////////////////////////////////////////////////////////////////////////////
//
// accounts_alarms.cfg
//
///////////////////////////////////////////////////////////////////////////////

[other alarms omitted...]

///////////////////////////////////////////////////////////////////////////////

PwckWarning

        init
                status active
                level warning
                task "Report /etc/passwd & /etc/shadow file problems
                      as found by pwck"
                input proc "=pwck -r 2>&1 | =egrep -v 'no changes'"

        rule
                output mail $inlin

///////////////////////////////////////////////////////////////////////////////

[other alarms omitted...]

///////////////////////////////////////////////////////////////////////////////
In this script, the pwck program does the real work.  We wrap pwck within the PwckWarning Pikt script to take advantage of PIKT's scheduling, reporting, and logging facilities.

[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.

Computer Books at Amazon.com

Linux Server Hacks
Linux Server Hacks

Snort 2.1 Intrusion Detection
Snort 2.1 Intrusion Detection

Red Hat Enterprise Linux & Fedora Edition
Red Hat Enterprise Linux & Fedora Edition

Introduction to Computer Security
Introduction to Computer Security

Computer Network Security
Computer Network Security