Xymon Mailing List Archive search

Minor tweak for the HP-UX client, possibly others for df output

4 messages in this thread

list Mark Deiss · Wed, 5 Oct 2005 06:02:39 -0500 ·
Some sites that have 'df" filesystem listings that span multiple lines may
need to consolidate each filesystem listing onto a single line.   Noticed
that the Hobbit rrd entries for our HPs have some "interesting" results ...

Just add the sed filter listed below to clean up the lines. Multiple lines
can occur on HP-UX servers that have long volume group names, think it may
also happen on some versions of Linux boxes, AIX boxes. Filter below is what
is incorporated in BB. 


in hobbitclient-hpux.sh file:

Before -

echo "[df]"
/usr/bin/df -Pk 


After -

echo "[df]"
/usr/bin/df -Pk | sed -e '/^[^  ][^     ]*$/{
N
s/[     ]*\n[   ]*/ /
}'
list Neil Ybusa-kop Brookins · Wed, 5 Oct 2005 09:48:46 -0400 ·
On HP-UX there are two versions of "df". One is called "df" the other is
called "bdf". I think that bdf with the appropriate flags will always
give output onto a single line; therefore eliminating the need to use
"sed". I would think a solution that results in a single output line
without needing sed would be preferred. (faster running, cleaner code)

I don't have an HP-UX box handy to test bdf on right now; I'm stating
this information from memory.

 
Linux boxes using the GNU df command always output a single line when
used with the "-P" option. Sed is not needed on Linux.

 
Neil G. Brookins

 
From: Deiss, Mark [mailto:user-5cd8675c2346@xymon.invalid] Sent: Wednesday, October 05, 2005 7:03 AM
To: 'user-ae9b8668bcde@xymon.invalid'
Subject: [hobbit] Minor tweak for the HP-UX client, possibly others for
df output
quoted from Mark Deiss

 
Some sites that have 'df" filesystem listings that span multiple lines
may need to consolidate each filesystem listing onto a single line.
Noticed that the Hobbit rrd entries for our HPs have some "interesting"
results ...

Just add the sed filter listed below to clean up the lines. Multiple
lines can occur on HP-UX servers that have long volume group names,
think it may also happen on some versions of Linux boxes, AIX boxes.
Filter below is what is incorporated in BB. 
 
in hobbitclient-hpux.sh file: 
Before - 
echo "[df]" /usr/bin/df -Pk 
 
After - 
echo "[df]" /usr/bin/df -Pk | sed -e '/^[^  ][^     ]*$/{ N s/[     ]*\n[   ]*/ / }'
list Lars Ebeling · Wed, 5 Oct 2005 16:01:28 +0200 ·
Minor tweak for the HP-UX client, possibly others for df outputExtract from bdf manpage:

If file system names are too long, the output for a given entry is   displayed on two lines.                                                                                                                   Regards
Lars
  ----- Original Message -----   From: Brookins, Neil (YBUSA-KOP)   To: user-ae9b8668bcde@xymon.invalid   Sent: Wednesday, October 05, 2005 3:48 PM
  Subject: RE: [hobbit] Minor tweak for the HP-UX client, possibly others for df output
quoted from Neil Ybusa-kop Brookins


  On HP-UX there are two versions of "df". One is called "df" the other is called "bdf". I think that bdf with the appropriate flags will always give output onto a single line; therefore eliminating the need to use "sed". I would think a solution that results in a single output line without needing sed would be preferred. (faster running, cleaner code)

  I don't have an HP-UX box handy to test bdf on right now; I'm stating this information from memory.


  Linux boxes using the GNU df command always output a single line when used with the "-P" option. Sed is not needed on Linux.


  Neil G. Brookins


  From: Deiss, Mark [mailto:user-5cd8675c2346@xymon.invalid]   Sent: Wednesday, October 05, 2005 7:03 AM
  To: 'user-ae9b8668bcde@xymon.invalid'
  Subject: [hobbit] Minor tweak for the HP-UX client, possibly others for df output


  Some sites that have 'df" filesystem listings that span multiple lines may need to consolidate each filesystem listing onto a single line.   Noticed that the Hobbit rrd entries for our HPs have some "interesting" results ...

  Just add the sed filter listed below to clean up the lines. Multiple lines can occur on HP-UX servers that have long volume group names, think it may also happen on some versions of Linux boxes, AIX boxes. Filter below is what is incorporated in BB. 


  in hobbitclient-hpux.sh file: 
  Before - 
  echo "[df]"   /usr/bin/df -Pk 


  After - 
  echo "[df]"   /usr/bin/df -Pk | sed -e '/^[^  ][^     ]*$/{   N   s/[     ]*\n[   ]*/ /   }'
list Henrik Størner · Sun, 9 Oct 2005 22:07:03 +0200 ·
quoted from Lars Ebeling
On Wed, Oct 05, 2005 at 06:02:39AM -0500, Deiss, Mark wrote:
Some sites that have 'df" filesystem listings that span multiple lines may
need to consolidate each filesystem listing onto a single line.   Noticed
that the Hobbit rrd entries for our HPs have some "interesting" results ...

Just add the sed filter listed below to clean up the lines.
Thanks, applied.


Henrik