[MacPorts] #43644: xymon-client port on Mac OS X cannot handle volumes with spaces in name
#43644: xymon-client port on Mac OS X cannot handle volumes with spaces in name ---------------------------+----------------------------------------------- Reporter: | Owner: macports-tickets@… MacPorts.ORG@… | Status: new Type: defect | Milestone: MacPorts Future Priority: Normal | Version: 2.2.1 Component: ports | Port: xymon-server, xymon, xymon-client Keywords: xymon | ---------------------------+----------------------------------------------- Many Macs have hard drives with a default name like "Macintosh HD". They also may have a Time Machine volume with a name like "Time Machine" or "Time Machine Backups". The present Mac port of the Xymon client code does not deal well with this. Only the first element (e.g. "/Volumes/Macintosh" or "/Volumes/Time") is emitted from the "xymonclient-darwin.sh" script. This is present not only in the Xymon 4.3.10 code in the current MacPorts port but also in the current Xymon 4.3.17 mainline release. This makes it very difficult to use Xymon in a work environment where one might like to monitor Macs as well as more common (Linux, Solaris) systems. I am creating this ticket in hopes that Xymon author Henrik Størner and Xymon MacPorts port maintainer François Claire can somehow find a way to fix this :-) Please see attachment for partial fix and suggestion for changing the ''df'' processing section to one that is iterative over the output of the the original ''df''. -- Ticket URL: <https://trac.macports.org/ticket/43644> MacPorts <http://www.macports.org/> Ports system for OS X
#43644: xymon-client port on Mac OS X cannot handle volumes with spaces in name ------------------------------------------------+-------------------------- Reporter: MacPorts.ORG@… | Owner: macports- Type: defect | tickets@… Priority: Normal | Status: new Component: ports | Milestone: MacPorts Resolution: | Future Port: xymon-server, xymon, xymon-client | Version: 2.2.1 | Keywords: xymon ------------------------------------------------+-------------------------- Comment (by MacPorts.ORG@…): This is still a work in progress obviously, but here are the changes I'm working with at the moment. I don't understand some of the original code (why use ''column'' to columnize it?), but at least at this point the "'''[df]'''" and "'''[inode]'''" outputs look 'correct'. The real problem is getting the server to interpret the raw data correctly and match it to my ''analysis.cfg'' rules ... I don't know where in the server code that's done. {{{ macmini:/<4>client/bin % diff -ru xymonclient-darwin.sh.dist xymonclient- darwin.sh --- xymonclient-darwin.sh.dist 2012-08-02 08:51:05.000000000 -0700 +++ xymonclient-darwin.sh 2014-05-09 03:45:09.000000000 -0700 @@ -26,26 +26,36 @@ echo "[who]" who -FILESYSTEMS=`mount | grep -v nobrowse | awk '{print $3}'` +#FILESYSTEMS=`mount | grep -v nobrowse | awk '{print $3}'` +#FILESYSTEMS=`mount | grep -v nobrowse | sed -e 's/^.* on \(.*\) [(].*$/\1/g'` echo "[df]" -set $FILESYSTEMS -(df -H $1; shift - while test $# -gt 0 - do - df -H $1 | tail -1 - shift - done) | column -t -s " " | sed -e 's!Mounted *on!Mounted on!' +#set $FILESYSTEMS +#(df -H $1; shift +# while test $# -gt 0 +# do +# df -H $1 | tail -1 +# shift +# done) | column -t -s " " | sed -e 's!Mounted *on!Mounted on!' + +# XXX [GKE 2/26/2014] +#df -h -t hfs,ntfs | column -t -s " " | sed -e 's!Mounted *on!Mounted on!' +df -P -h -t hfs,ntfs echo "[inode]" -set $FILESYSTEMS -(df -i $1; shift - while test $# -gt 0 - do - df -H $1 | tail -1 - shift - done) | awk ' -NR<2{printf "%-20s %10s %10s %10s %10s %s\n", $1, "itotal", $6, $7, $8, $9} -(NR>=2 && $6>0) {printf "%-20s %10d %10d %10d %10s %s\n", $1, $6+$7, $6, $7, $8, $9}' +#set $FILESYSTEMS +#(df -i $1; shift +# while test $# -gt 0 +# do +# df -H $1 | tail -1 +# shift +# done) | awk ' +#NR<2{printf "%-20s %10s %10s %10s %10s %s\n", $1, "itotal", $6, $7, $8, $9} +#(NR>=2 && $6>0) {printf "%-20s %10d %10d %10d %10s %s\n", $1, $6+$7, $6, $7, $8, $9}' + +# XXX [GKE 2/26/2014] +df -h -i -t hfs,ntfs | awk ' +NR<2{printf "%-20s %10s %10s %10s %10s %s\n", $1, "itotal", $6, $7, $8, $9} +(NR>=2 && $6>0) {printf "%-20s %10d %10d %10d %10s %s %s %s %s\n", $1, $6+$7, $6, $7, $8, $9, $10, $11, $12}' echo "[mount]" mount }}} -- Ticket URL: <https://trac.macports.org/ticket/43644#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#43644: xymon-client port on Mac OS X cannot handle volumes with spaces in name ------------------------------------------------+----------------------- Reporter: MacPorts.ORG@… | Owner: fclaire@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: xymon-server, xymon, xymon-client | ------------------------------------------------+----------------------- Changes (by ryandesign@…): * keywords: xymon => * owner: macports-tickets@… => fclaire@… * milestone: MacPorts Future => -- Ticket URL: <https://trac.macports.org/ticket/43644#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#43644: xymon-client port on Mac OS X cannot handle volumes with spaces in name ------------------------------------------------+----------------------- Reporter: MacPorts.ORG@… | Owner: fclaire@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: xymon-server, xymon, xymon-client | ------------------------------------------------+----------------------- Comment (by fclaire@…): Thanks for reporting the problem and proposing a fix. I'll have a look at it. I might as well update the xymon macports to 4.3.17. -- Ticket URL: <https://trac.macports.org/ticket/43644#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#43644: xymon-client port on Mac OS X cannot handle volumes with spaces in name ------------------------------------------------+----------------------- Reporter: MacPorts.ORG@… | Owner: fclaire@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: xymon-server, xymon, xymon-client | ------------------------------------------------+----------------------- Comment (by MacPorts.ORG@…): Merci François :-) I believe there are two issues here: (1) Why does this ''xymonclient-darwin.sh'' script output what it does, with all the ''awk'' massaging etc., instead of just the "raw" ''df''/''df -i'' output. What does the server side expect as input? (2) Where in the server-side code is this output processed? Because even with my current diffs above, nothing I have tried RE-wise on the server side gets it to recognize a partition/volume name with spaces in it. In other words, this entry {{{ HOST=macmini DISK %(?-i)^.*/Volumes/Time 98 99 INODE %(?-i)^.*/Volumes/Time 98 99 }}} works to suppress the alerts; this {{{ HOST=macmini DISK %(?-i)^.*/Volumes/Time\sMachine\sBackups 98 99 INODE %(?-i)^.*/Volumes/Time\sMachine\sBackups 98 99 }}} does not. The latter results in an alert reading {{{ red Fri May 9 12:03:20 PDT 2014 - Filesystems NOT ok &red <!-- ID=/Volumes/Time Machine Backups --> /Volumes/Time Machine Backups (97% used) has reached the PANIC level (95%) &yellow <!-- ID=/Volumes/Macintosh HD --> /Volumes/Macintosh HD (93% used) has reached the WARNING level (90%) Filesystem itotal iused ifree %iused Mounted /dev/disk0s2 237145994 178215621 58930373 75% / /dev/disk1s2 244106666 237239564 6867102 97% /Volumes/Time Machine Backups /dev/disk0s4 4347580 101211 4246369 2% /Volumes/BOOTCAMP /dev/disk2s2 176632084 164649661 11982423 93% /Volumes/Macintosh HD /dev/disk2s4 9538076 81941 9456135 1% /Volumes/BOOTCAMP 1 }}} so even though the ''df'' output is 'correct', something on the server end is not matching the volume string. I don't know where that code is. (I also don't understand where the "'''<!-- ID='''"/"'''-->'''" comes from.) (''In case that output looks confusing, I have the machine my current one replaced connected via FireWire Target Mode.'') -- Ticket URL: <https://trac.macports.org/ticket/43644#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#43644: xymon-client port on Mac OS X cannot handle volumes with spaces in name ----------------------------------------+----------------------- Reporter: MacPorts.ORG@… | Owner: fclaire@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: xymon-server xymon-client | ----------------------------------------+----------------------- Changes (by mf2k@…): * port: xymon-server, xymon, xymon-client => xymon-server xymon-client -- Ticket URL: <https://trac.macports.org/ticket/43644#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#43644: xymon-client port on Mac OS X cannot handle volumes with spaces in name ----------------------------------------+----------------------- Reporter: MacPorts.ORG@… | Owner: fclaire@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: xymon-server xymon-client | ----------------------------------------+----------------------- Comment (by fclaire@…): Hi, I plan to update the xymon ports to the soon-to-be-released 4.3.18. -- Ticket URL: <https://trac.macports.org/ticket/43644#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts