<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: BDF notification script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166239#M160318</link>
    <description>Next one also works fine:&lt;BR /&gt;#######Begin&lt;BR /&gt;{&lt;BR /&gt;bdf | grep -v Filesystem | awk '{ print $1 " " $5-1 }' | while read fsys per&lt;BR /&gt;do&lt;BR /&gt;if [ $per -gt 95 ]&lt;BR /&gt;then&lt;BR /&gt;echo $fsys $per&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;} | mailx -s "filesystem more then 95% used" email@yourdomain.com&lt;BR /&gt;######End&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Peter Geluk</description>
    <pubDate>Fri, 16 Jan 2004 08:05:07 GMT</pubDate>
    <dc:creator>Hoefnix</dc:creator>
    <dc:date>2004-01-16T08:05:07Z</dc:date>
    <item>
      <title>BDF notification script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166236#M160315</link>
      <description>hI GUYS &lt;BR /&gt;     scripting is not my strongest point and i am trying to get this script to work, i do believe in trying to keep things simple.&lt;BR /&gt;i have written a script to check the bdf output and email if the output exceeds 95%.&lt;BR /&gt;the problem is that although the script works and emails, it still emails if the check has produced no output due to there being no filesystems in excess of 95%.&lt;BR /&gt;what do i need to do to get the test to work correctly or have i made a mistake in how i am testing it.&lt;BR /&gt;attached is the script&lt;BR /&gt;regards &lt;BR /&gt;andrew</description>
      <pubDate>Fri, 16 Jan 2004 07:24:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166236#M160315</guid>
      <dc:creator>system administrator_15</dc:creator>
      <dc:date>2004-01-16T07:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: BDF notification script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166237#M160316</link>
      <description>it is normal because if read fails ARG1 keep its value,&lt;BR /&gt;&lt;BR /&gt;So you should do:&lt;BR /&gt;bdf | awk ' $5 &amp;gt;= 95 {print $5,$6 }' &amp;gt; /tmp/filesystem_check_file&lt;BR /&gt;&lt;BR /&gt;while read ARG1 ARG2&lt;BR /&gt;do&lt;BR /&gt; echo "the following Filesystem has exceeded 90 percent and is currently at : "$ARG1",  filesystem: "$ARG2" " |  mailx -s "Filesystem Problem" email addressxxxxxxxxxxxxx&lt;BR /&gt;done&amp;lt; "$parameter_file"</description>
      <pubDate>Fri, 16 Jan 2004 07:42:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166237#M160316</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2004-01-16T07:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: BDF notification script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166238#M160317</link>
      <description>I think this version might work a bit better. In your version multiple filesystems over 90% will only report the first one, for instance.</description>
      <pubDate>Fri, 16 Jan 2004 07:58:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166238#M160317</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2004-01-16T07:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: BDF notification script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166239#M160318</link>
      <description>Next one also works fine:&lt;BR /&gt;#######Begin&lt;BR /&gt;{&lt;BR /&gt;bdf | grep -v Filesystem | awk '{ print $1 " " $5-1 }' | while read fsys per&lt;BR /&gt;do&lt;BR /&gt;if [ $per -gt 95 ]&lt;BR /&gt;then&lt;BR /&gt;echo $fsys $per&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;} | mailx -s "filesystem more then 95% used" email@yourdomain.com&lt;BR /&gt;######End&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Peter Geluk</description>
      <pubDate>Fri, 16 Jan 2004 08:05:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166239#M160318</guid>
      <dc:creator>Hoefnix</dc:creator>
      <dc:date>2004-01-16T08:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: BDF notification script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166240#M160319</link>
      <description>Hi,&lt;BR /&gt;I don't know why it doesn't work but in attachment you will see BDF notification script that I am using...&lt;BR /&gt;&lt;BR /&gt;I hope this helps you.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Ettore</description>
      <pubDate>Fri, 16 Jan 2004 08:09:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166240#M160319</guid>
      <dc:creator>Fabio Ettore</dc:creator>
      <dc:date>2004-01-16T08:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: BDF notification script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166241#M160320</link>
      <description>bdf | awk ' $5 &amp;gt;= 95 {print $5,$6 }' | tee $parameter_file | read ARG1&lt;BR /&gt;&lt;BR /&gt;I think why its not working is that $5 contains for exmpl: "96%" and not "96"&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Peter</description>
      <pubDate>Fri, 16 Jan 2004 08:12:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166241#M160320</guid>
      <dc:creator>Hoefnix</dc:creator>
      <dc:date>2004-01-16T08:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: BDF notification script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166242#M160321</link>
      <description>peter can you explain what you mean about containing 96% example i can not see it in the script i sent.&lt;BR /&gt;regards&lt;BR /&gt;andrew</description>
      <pubDate>Fri, 16 Jan 2004 09:04:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166242#M160321</guid>
      <dc:creator>system administrator_15</dc:creator>
      <dc:date>2004-01-16T09:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: BDF notification script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166243#M160322</link>
      <description>Yes Peter is right,&lt;BR /&gt;&lt;BR /&gt;the % make it doesn't work.&lt;BR /&gt;Sometimes the line is cut too.&lt;BR /&gt;bdf | tr "%" " "| ' ((NR&amp;gt;1)&amp;amp;&amp;amp;(NF&amp;gt;2)&amp;amp;&amp;amp; ($(NF-1) &amp;gt;= 50 )){print $(NF-1),$NF }'|&lt;BR /&gt;while read ARG1 ARG2&lt;BR /&gt;do&lt;BR /&gt;echo "the following Filesystem has exceeded 90 percent and is currently at : "$ARG1", filesystem: "$ARG2" " | mailx -s "Filesystem Problem" email addressxxxxxxxxxxxxx&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Jan 2004 09:09:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166243#M160322</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2004-01-16T09:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: BDF notification script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166244#M160323</link>
      <description>What Peter meant, is that $5 in the awk statement is not only containing the numeric percentage value, but the percentage sign itself too. But I've tested and this isn't a problem for awk, it will work quite well.&lt;BR /&gt;&lt;BR /&gt;I think your problem might be related with something else. Please check your bdf output if all filesystems are on 1 line of output. Sometimes (especially with NFS mounts) the output can be spread over multiple lines.&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Jan 2004 09:18:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166244#M160323</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2004-01-16T09:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: BDF notification script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166245#M160324</link>
      <description>the % is not a problem as long as the value is lower than 100.&lt;BR /&gt;&lt;BR /&gt;just test&lt;BR /&gt;echo "100% 1\n95% 2" |awk ' $1&amp;gt;95 { print $0 }'&lt;BR /&gt;It will print&lt;BR /&gt;95% 2</description>
      <pubDate>Fri, 16 Jan 2004 09:24:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166245#M160324</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2004-01-16T09:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: BDF notification script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166246#M160325</link>
      <description>Sorry for the delay, was driving home from work.&lt;BR /&gt;&lt;BR /&gt;Adrew, I did not test your script, but when I was testing my script, I only did a print of $5 and saw that it include the % sign so I thougth the test on the greater or equal then 95 went wrong.&lt;BR /&gt;&lt;BR /&gt;One remark on my script is that it always will send an email, also when none of the filesystems are above 95% used.&lt;BR /&gt;You can simply replace the mailx by a redirect in a file and test the linecount of the file before sending the mail.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hopes this helps, regards,&lt;BR /&gt;&lt;BR /&gt;Peter&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Jan 2004 10:47:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166246#M160325</guid>
      <dc:creator>Hoefnix</dc:creator>
      <dc:date>2004-01-16T10:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: BDF notification script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166247#M160326</link>
      <description>Attaching my version.&lt;BR /&gt;&lt;BR /&gt;Didn't have time to read the thread posting. Apologies if its redundant.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Fri, 16 Jan 2004 11:46:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166247#M160326</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-01-16T11:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: BDF notification script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166248#M160327</link>
      <description>Hi Andrew,&lt;BR /&gt;&lt;BR /&gt;Using 'awk' on bdf may not give 100% results particularly if you have the longer logical volumes.&lt;BR /&gt;&lt;BR /&gt;I would use df like below.&lt;BR /&gt;&lt;BR /&gt;THRESHOLD=90&lt;BR /&gt;PERCENT=$(df -k /filesystem|awk '/allocation used/ {print $1}')&lt;BR /&gt;&lt;BR /&gt;if [ $PERCENT -ge 90 ]&lt;BR /&gt;then&lt;BR /&gt;do_your_action&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Fri, 16 Jan 2004 12:07:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166248#M160327</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-01-16T12:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: BDF notification script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166249#M160328</link>
      <description>This is the one I use.  In the email list, you have to remember to put the \ before the @ sign.  Set the reportful value to whatever you want as a threshold value and run it&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Jan 2004 12:48:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166249#M160328</guid>
      <dc:creator>Gary L. Paveza, Jr.</dc:creator>
      <dc:date>2004-01-16T12:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: BDF notification script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166250#M160329</link>
      <description>Andrew,&lt;BR /&gt;&lt;BR /&gt;Here is a portion of a script I use for disk space notifications:&lt;BR /&gt;&lt;BR /&gt;# Check disk space&lt;BR /&gt;echo "\nChecking directory capacities:" &amp;gt;&amp;gt; $BASE/checklist.log&lt;BR /&gt;bdf | grep "^/dev" | while  read line&lt;BR /&gt;do&lt;BR /&gt;        set $line&lt;BR /&gt;        PCT=0&lt;BR /&gt;        PCT=$(echo $3 $2 | awk '{printf "%10.0f",$1/$2*100}')&lt;BR /&gt;        if [ $PCT -ge 80 ] ; then&lt;BR /&gt;                echo "$line" &amp;gt;&amp;gt; $BASE/checklist.log&lt;BR /&gt;                echo "$line" &amp;gt;&amp;gt; $BASE/dskchecklist&lt;BR /&gt;        fi&lt;BR /&gt;done&lt;BR /&gt;echo "\nAll directories have been checked." &amp;gt;&amp;gt; $BASE/checklist.log&lt;BR /&gt;echo "If necessary, the Admins have been notified." &amp;gt;&amp;gt; $BASE/checklist.log&lt;BR /&gt;&lt;BR /&gt;"checklist.log" is mailed to me (it has other stuff logged into it as well.&lt;BR /&gt;"dskchecklist" is mailed to the "resource hogs."  :)&lt;BR /&gt;You'll also notice my threshold is 80%.&lt;BR /&gt;&lt;BR /&gt;D</description>
      <pubDate>Fri, 16 Jan 2004 14:32:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166250#M160329</guid>
      <dc:creator>Dwyane Everts_1</dc:creator>
      <dc:date>2004-01-16T14:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: BDF notification script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166251#M160330</link>
      <description>I think there are a lot of answers to your issue here.&lt;BR /&gt;&lt;BR /&gt;If you really want notification though, and can't afford HP OpenView, why not get Big Brother:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://bb4.com/" target="_blank"&gt;http://bb4.com/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Easy to setup, gives you notification and a web page view of current devices.&lt;BR /&gt;&lt;BR /&gt;BTW - it uses df for disk threshholds.&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Jan 2004 14:39:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bdf-notification-script/m-p/3166251#M160330</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-01-16T14:39:47Z</dc:date>
    </item>
  </channel>
</rss>

