HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: check system
Operating System - HP-UX
1833873
Members
1690
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
08-19-2009 11:41 PM
08-19-2009 11:41 PM
check system
I would like to write a script to check do the system ,
if the directory size larger than xxx KB or no.of files is more that xxx , then send alert mail to me , can adivse what can i do ?
can advise what can i do ? thx
if the directory size larger than xxx KB or no.of files is more that xxx , then send alert mail to me , can adivse what can i do ?
can advise what can i do ? thx
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2009 11:56 PM
08-19-2009 11:56 PM
Re: check system
Hi,
first advice - use the search option of this forum!
Examples:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=419106
http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1237836
http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=847833
General tipps:
http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=131801
HTH
Volkmar
first advice - use the search option of this forum!
Examples:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=419106
http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1237836
http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=847833
General tipps:
http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=131801
HTH
Volkmar
*** Say 'Thanks' with Kudos ***
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2009 12:09 AM
08-20-2009 12:09 AM
Re: check system
Hi,
hopefully i did understand correct what you need - try this:
#!/usr/bin/sh
alert=0
alertsize=20000
alertfiles=500
alertemail=someone@domain.com
checkdir=/tmp
checksize=$(bdf $checkdir | tail -n 1 | awk '{print $3}')
checkcount=$(ll $checkdir | wc -l)
if [[ $checksize -ge $alertsize ]]
then
alert=1
fi
if [[ $alert = 1 ]]
then
echo "$(hostname): $checkdir contains $checkcount files and has $checksize kb used Space" | mailx -s "ALERT" $alertemail
fi
hopefully i did understand correct what you need - try this:
#!/usr/bin/sh
alert=0
alertsize=20000
alertfiles=500
alertemail=someone@domain.com
checkdir=/tmp
checksize=$(bdf $checkdir | tail -n 1 | awk '{print $3}')
checkcount=$(ll $checkdir | wc -l)
if [[ $checksize -ge $alertsize ]]
then
alert=1
fi
if [[ $alert = 1 ]]
then
echo "$(hostname): $checkdir contains $checkcount files and has $checksize kb used Space" | mailx -s "ALERT" $alertemail
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2009 02:04 AM
08-20-2009 02:04 AM
Re: check system
ops, just saw that i missed a part, please use this ...
#!/usr/bin/sh
alert=0
alertsize=20000
alertfiles=500
alertemail=someone@domain.com
checkdir=/tmp
checksize=$(bdf $checkdir | tail -n 1 | awk '{print $3}')
checkcount=$(ll $checkdir | wc -l)
if [[ $checksize -ge $alertsize ]]
then
alert=1
fi
if [[ $checkcount -ge $alertfiles ]]
then
alert=1
fi
if [[ $alert = 1 ]]
then
echo "$(hostname): $checkdir contains $checkcount files and has $checksize kb used Space" | mailx -s "ALERT" $alertemail
fi
#!/usr/bin/sh
alert=0
alertsize=20000
alertfiles=500
alertemail=someone@domain.com
checkdir=/tmp
checksize=$(bdf $checkdir | tail -n 1 | awk '{print $3}')
checkcount=$(ll $checkdir | wc -l)
if [[ $checksize -ge $alertsize ]]
then
alert=1
fi
if [[ $checkcount -ge $alertfiles ]]
then
alert=1
fi
if [[ $alert = 1 ]]
then
echo "$(hostname): $checkdir contains $checkcount files and has $checksize kb used Space" | mailx -s "ALERT" $alertemail
fi
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP