- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: e-mail notification when number of files in di...
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
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
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
03-20-2014 07:57 AM - last edited on 03-20-2014 07:07 PM by Maiko-I
03-20-2014 07:57 AM - last edited on 03-20-2014 07:07 PM by Maiko-I
Hi,
I need help on email notification from HP-UX v3 server.
If my /tmp/ftp/incoming folder is having more than 100 files then I should get email allert.
This check should happen every 10min everyday.
I have already configured sendmail.
thanks n regards,
Jos
P.S. This thread has been moevd from System Administration to HP-UX > languages. - Hp Forum MOderator
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2014 09:06 AM
03-20-2014 09:06 AM
SolutionThis script should get you started:
# cat filecount.sh
#!/usr/bin/sh
FILE_COUNT=$(find /tmp/ftp/incoming -type f | wc -l)
if (( $FILE_COUNT > 100 )) ; then
echo "More than 100 files. Current file count: ${FILE_COUNT}" | mailx -s "Incoming FTP File Count" you@yourdomain.com
fi
Put this script in a directory somewhere, make sure it has execute permission set and then run it via cron.
0,10,20,30,40,50 * * * * /some/dir/filecount.sh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2014 09:42 AM
03-20-2014 09:42 AM
Re: e-mail notification when number of files in directory increases more than 100
Thanks Patrick,
Can you please help me with a script with mail notification if my NFS server is not available.
Thanks n Regards,
Jos
- Tags:
- NFS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2014 12:04 PM
03-20-2014 12:04 PM
Re: e-mail notification when number of files in directory increases more than 100
Hi,
Please help me to configure email notification from my NFS client server to send when NFS server is not available
Thanks n Regards,
Jos
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2014 06:01 PM - edited 03-24-2014 06:03 PM
03-24-2014 06:01 PM - edited 03-24-2014 06:03 PM
Re: e-mail notification when number of files in directory increases more than 100
NFS not available is not easy to detect. If you run bdf or check for a file, it will just hang so your script won't complete.
Attached is a general purpose sysadmin alert script that will handle the following conditions:
-- CPU load limit exceeded
-- Mountpoints too full
-- NFS not responding
-- ping test
-- Process monitor (not enough or too many)
This script is particularly useful in that it prevents sending hundreds of messages when the problem(s) can't be immediately fixed. Each notification starts a timer and if the problem has not been resolved, another message won't be sent until the EMAILFREQ (in minutes) has been exceeded. So even though the script can be run every 5 minutes, only one email per monitored event will be sent during the EMAILFREQ period.
Running the script the first time creates the config file automatically. You then edit the config script to turn on whatever features you'd like to monitor. Be sure to put the script in /usr/contrib/bin and make it executable.
Bill Hassell, sysadmin