- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Filesystem monitoring script
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
Forums
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
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
04-19-2009 09:51 PM
04-19-2009 09:51 PM
I am running this script in cron job...but the problem is that even if the threshold doesn't exceed i am getting an blank e-mail for this script and if the threshold exceed i am getting the mail for the alerts which is fine. But i don't want any blank mail if threshold doesn't exceed as this unnecessary full my inbox.
bdf /oracle/TCP/saparch |awk 'NF==1{f=$0;getline;$0=f$0}{if($5+0>65)print}' > mailx -s"FileSystem on HOSTNAME" narendra@xxxxx.com
Thanks,
Narendra
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2009 09:59 PM
04-19-2009 09:59 PM
SolutionWhen ur filesystem is not >65 output of bdf /oracle/TCP/saparch |awk 'NF==1{f=$0;getline;$0=f$0}{if($5+0>65)print}' is balnk and its going to ut mailbox.
If you do not want blank mails you have to guide it using if else statment
if output >65
else
nothing ;)
Let us know if you need exact statments.
BR,
Kapil+
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2009 10:47 PM
04-19-2009 10:47 PM
Re: Filesystem monitoring script
Please download this file (bdfmesg) from below link you will find this is a great tool written by Mr.Bill Hassell.
http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1326767
Just give
#bdfmesg -P 80 ##to find all file system which is using 80 or more then 80
Like so many output you can take from bdfmesg
Many Thanks to Mr.Bill Hassell to create a nice and useful tool.
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2009 12:42 AM
04-20-2009 12:42 AM
Re: Filesystem monitoring script
Kapil thanks for the info...But please can you send me the exact syntax, so that i can modify the same.
Thanks,
Narendra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2009 02:39 AM
04-20-2009 02:39 AM
Re: Filesystem monitoring script
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1324214
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2009 07:44 PM
04-21-2009 07:44 PM
Re: Filesystem monitoring script
#!/usr/bin/sh
abc=`bdf /oracle/TCP/saparch |awk 'NF==1{f=$0;getline;$0=f$0}{if($5+0>65)print}'`
if [ abc != null ] ; then
abc > mailx -s"FileSystem on HOSTNAME" narendra@xxxxx.com
else
echo "free" >/dev/null
fi
BR,
Kapil+
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2009 10:21 PM
04-21-2009 10:21 PM
Re: Filesystem monitoring script
Kapil i tried your script but while running gives an error [./disk2.sh[4]: abc: not found.]
I don't know much of the scripting, please let me know what to correct.
Thanks,
Narendra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2009 10:42 PM
04-21-2009 10:42 PM
Re: Filesystem monitoring script
Kapil for monitoring the file system i am using this 2 scripts. But the problem with this script is that it doesn't sent me the alert for /oracle/TCP/saparch , /oracle/TCP/102_64 and /usr/sap/TCP. For all other file systems i am getting alerts. I don't know why it is not working as expected. That's why i thought i will run other script to monitor this file system.
Please find the attached scipts, please let me know if any correction required so that i can modify the same, so that i can start receiving the alerts for this file system as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2009 10:43 PM
04-21-2009 10:43 PM
Re: Filesystem monitoring script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2009 11:46 AM
04-22-2009 11:46 AM
Re: Filesystem monitoring script
this line has bad syntax:
if (("${PCT}>${MAX_THRESH}"))
the correct way to check if the percent is larger than allowed is:
if [ "${PCT[$i]}" -gt "${MAX_THRESH[$i]}" ]
then
.... do some useful things
fi
the '[ ]' symbols after the if statement are abbreviations for the test command, try 'man test' for more info...
( -gt is for "greater than" )
mark that you should use the arrays this way:
${VARIABLE[$index]}
Unix operates with beer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2009 12:28 PM
04-22-2009 12:28 PM
Re: Filesystem monitoring script
Unix operates with beer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2009 12:30 PM
04-22-2009 12:30 PM
Re: Filesystem monitoring script
Unix operates with beer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2009 11:22 PM
04-22-2009 11:22 PM
Re: Filesystem monitoring script
Viktor thanks for the info...i modified the scripts as you suggested, but while executing i am getting an error as below,
./disk.sh[17]: /tmp/sapwork: syntax error
./disk.sh[17]: /opt/sapbc47: syntax error
./disk.sh[17]: /sapmnt/TCP: syntax error
./disk.sh[17]: /usr/sap/TCP: syntax error
But /var /opt /home /tmp are excuting properly without an error but it gives an error /opt/sapbc47
Please advise what syntax correction needs to do...Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2009 12:14 AM
04-23-2009 12:14 AM
Re: Filesystem monitoring script
The config file should look like this:
FS[0]=/ ; TRESH[0]=40
...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2009 05:35 AM
04-23-2009 05:35 AM
Re: Filesystem monitoring script
Pls try attached script. hope this will help u.
Thanks
Prashant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2009 11:00 PM
08-18-2009 11:00 PM