- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Perl script to monitor filesystem?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2016 10:58 AM
тАО05-11-2016 10:58 AM
Perl script to monitor filesystem?
Is there a Perl script that will monitor the filesystem and email if there is a full filesystem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2016 10:24 PM - edited тАО05-11-2016 10:26 PM
тАО05-11-2016 10:24 PM - edited тАО05-11-2016 10:26 PM
Re: Perl script to monitor filesystem?
Attached is a shell script called adminalert.sh
This script can monitor all the mounted filesystems for a maximum percentage, or you can list selected mountpoints and specify indivdual percentage limits in the config file. Unlike simple scripts that will create an email storm of messages until the problem is fixed, this script will report once and then wait for an hour (configurable) before reporting the same condition.
It is actually a series of monitors:
CPU Load Alert
Filesystem Limits
NFS mount failures
Ping Servers
User lockouts
Here's a sample of the config file:
EMAILFREQ=60 EMAIL=bhassell@sourcedirect.com EMAILFROM=root@billhassell.com LogFile=true LoadAlert=0 LOADLIMIT=2.0 DiskFull=1 MOUNTS=/:95,/opt:85,/tmp:95,/var:95 NFSalert=0 NFSWAITSECS=3 NFSMOUNTS=/mnt2 PingTest=0 PINGHOSTS=ftp:8:3:20:true,atl3:5,atl6:8:3:20,atl10:8:3:20,atl5par1 ProcMon=0 PROCS=swapper,nfsd:16,httpd:1:4 UserLockCheck=1 LOCKED=root,blh,sduser
Here's the usage:
Usage: adminalert [-c] [-t] where -c = Just show the config file without comments -t = send test message to EMAIL from the config file Requires /etc/adminalert.config to run. The config file will have the name of the functions to invoke plus any variables for the functions. This means that the conditions to check can be enabled or disabled in realtime by editing the config file. To start, just run adminalert -c to see the default settings and to create the initial config file. Then edit the config file based on the comments.
Just add the script to cron and run it every few minutes.
You can select one or more monitor functions.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2016 10:25 PM
тАО05-11-2016 10:25 PM
Re: Perl script to monitor filesystem?
> Is there a Perl script that will monitor the filesystem [...]
Is Perl a requirement? (Why?) Define "monitor". I know nothing,
but I seem to recall repeatedly seeing similar requests for shell
scripts which would do this job (usually with the help of "cron",
looking at "df" output). Did your Web search for such scripts find
nothing?