[Xymon] Need client for Mac hosts
Brian Scott
bscott at bunyatech.com.au
Wed Dec 20 06:57:33 CET 2023
A few years ago I built a client for a Macos server. The target server
is quite a few versions of macos old so probably not what you are
looking for. I just built it on my Mac laptop then bundled it all up in
a tar file and copied it over and did some installation. My current
laptop is an M2 so I doubt I could do it again right now.
As I recall the xymonclient-darwin script was mostly fine. There was a
little entertainment with the way Apple manages it's disks these days.
I've attached what looks like the changes I made as a diff.
I'm not at $work at the moment so I can't check exactly what else I did.
I must have done something to get it to auto start at boot. Probably
didn't keep any notes either. I'll try to have a look next time I'm there.
Also quite possible that rclient will work well. There's some fixes that
I had to do recently to account for some dropped commands from rclient
when talking to FreeBSD systems so that may also be relevant.
Cheers,
Brian
On 19/12/2023 3:58 pm, Ralph M wrote:
> I would guess the script in the repository is the latest version. I'm
> not a Mac user, so take that as an opinion, not a fact. As part of
> the main distribution, any changes would have been rolled into that file.
>
> Ralph Mitchell
>
>
>
>
> On Mon, Dec 18, 2023 at 11:04 PM IO Support
> <support at ionetworkadmin.com> wrote:
>
> Where would I obtain a semi-current xymonclient-darwin.sh script?
> I will try to use the one I found in the latest branch on
> Sourceforge that JC has been working on, but it was last edited in
> 2015.
> https://sourceforge.net/p/xymon/code/HEAD/tree/branches/4.x-master/client/xymonclient-darwin.sh
>
> Does anyone have anything a little more current that they use?
>
> Thank You,
> Kris Springer
>
>
> On 12/14/23 12:21 PM, Ralph M wrote:
>> Would this do it for you??
>>
>> http://tools.rebel-it.com.au/xymon-rclient/
>>
>> Nothing to install on the remote host, other than SSH keys. It
>> fires the appropriate xymonclient-[OS].sh script down the SSH
>> connection and collects the results. I don't know anything about
>> Macs, but the xymonclient-darwin.sh script is for MacOS X so that
>> might be a good starting point.
>>
>> Ralph Mitchell
>>
>>
>>
>> On Thu, Dec 14, 2023 at 2:38 AM I/O Network Administration
>> <support at ionetworkadmin.com> wrote:
>>
>> Anyone have a modern xymon-client script or app that will run
>> on Mac? I'm aware of the macport method, but that's a large
>> footprint and heavy handed solution to the simple need of
>> collecting performance data and uploading it to the Server.
>>
>>
>>
>> Thank You,
>> Kris Springer
>> I/O Network Administration
>> https://www.ionetworkadmin.com
>>
>>
>>
>> _______________________________________________
>> Xymon mailing list
>> Xymon at xymon.com
>> http://lists.xymon.com/mailman/listinfo/xymon
>>
>
>
> _______________________________________________
> Xymon mailing list
> Xymon at xymon.com
> http://lists.xymon.com/mailman/listinfo/xymon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20231220/bda2593a/attachment.htm>
-------------- next part --------------
--- client/xymonclient-darwin.sh.orig 2015-10-20 09:34:59
+++ client/xymonclient-darwin.sh 2020-09-05 22:28:06
@@ -26,28 +26,62 @@
echo "[who]"
who
-FILESYSTEMS=`mount | sed -E '/[\( ](nobrowse|afs|read-only)[ ,\)]/d;s/^.* on (.*) \(.*$/\1/'`
+FILESYSTEMS=
+APFS=`mount | grep -E '[( ]apfs[,)]' | sed -E -e 's/s[0-9]{1,} .*/s/' | sort -u`
+for apfs in $APFS; do
+ # Find the 'best' mountpoint to use for this disk (whatever that means...)
+ mp=`mount|grep -E "^$apfs.*[( ]local[,)]"| grep -v '[( ](nobrowse|afs|nfs|smbfs|nullfs|devfs|read-only)[ ,)]'|head -1`
+ if [ -z "$mp" ]; then
+ mp=`mount|grep -E "^$apfs.*[( ]local[,)]"| grep -v '[( ](nobrowse|afs|nfs|smbfs|nullfs|devfs)[ ,)]'|head -1`
+ if [ -z "$mp" ]; then
+ mp=`mount|grep -E "^$apfs.*[( ]local[,)]"| grep -v '[( ](afs|nfs|smbfs|nullfs|devfs)[ ,)]'|head -1`
+ fi
+ fi
+ if [ -n "$mp" ]; then
+ mp=`echo $mp|sed -E -e 's/^.*on //' -e 's/ \(.*//'`
+ FILESYSTEMS="$FILESYSTEMS =$apfs $mp"
+ fi
+done
+FILESYSTEMS="$FILESYSTEMS "`mount | sed -E -e '/[\( ](nobrowse|afs|read-only|apfs)[ ,\)]/d' -e 's/^.* on (.*) \(.*$/\1/'`
+
echo "[df]"
-(IFS=$'\n'
- set $FILESYSTEMS
- df -P -H $1; shift
+(IFS=" "
+ set -- $FILESYSTEMS
+ df -P -H / | head -1
while test $# -gt 0
do
- df -P -H $1 | tail -1 | sed 's/\([^ ]\) \([^ ]\)/\1_\2/g'
+ case "$1" in
+ =*)
+ shift
+ df -P -m $1 | tail -1 | sed -E -e 's/s[0-9]{1,} */ /' | awk '{printf "%-20s %10dM %10dM %10dM %10d%% %s\n", $1, $2, $2-$4, $4, 100*($2-$4)/$2, $6}'
+ ;;
+ *)
+ df -P -H $1 | tail -1 | sed 's/\([^ ]\) \([^ ]\)/\1_\2/g'
+ ;;
+ esac
shift
done) | column -t -s " " | sed -e 's!Mounted *on!Mounted on!'
echo "[inode]"
-(IFS=$'\n'
- set $FILESYSTEMS
- df -P -i $1; shift
+(IFS=" "
+ set -- $FILESYSTEMS
+ df -i / | head -1
while test $# -gt 0
do
- df -P -H $1 | tail -1 | sed 's/\([^0123456789% ]\) \([^ ]\)/\1_\2/g'
+ case "$1" in
+ =*)
+ dev=`echo $1|cut -d= -f2-`
+ shift
+ df -i | grep "^$dev"
+ ;;
+ *)
+ df -i $1 | tail -1 | sed 's/\([^0123456789% ]\) \([^ ]\)/\1_\2/g'
+ ;;
+ esac
shift
done) | awk '
-NR<2{printf "%-20s %10s %10s %10s %10s %s\n", $1, "itotal", $6, $7, $8, $9}
+NR<2{printf "%-20s %10s %10s %10s %10s %s %s\n", $1, "itotal", $6, $7, $8, $9, $10}
(NR>=2 && $6>0) {printf "%-20s %10d %10d %10d %10s %s\n", $1, $6+$7, $6, $7, $8, $9}'
echo "[mount]"
@@ -59,7 +93,7 @@
echo "[route]"
netstat -rn
echo "[netstat]"
-netstat -s
+netstat -s 2>/dev/null
echo "[ifstat]"
netstat -ibn | egrep -v "^lo|<Link"
echo "[ports]"
More information about the Xymon
mailing list