Xymon Mailing List Archive search

Triggering on total memory?

3 messages in this thread

list Mark Wagner · Mon, 18 Jun 2012 00:25:41 -0700 ·
One of my servers has a quirk where it will occasionally fail to detect
two-thirds of its RAM on startup.  Is it possible to set things up to
send an alert if *total* RAM is below a certain amount?

-- 
Mark Wagner
list Neil Simmonds · Mon, 18 Jun 2012 08:32:32 +0100 ·
You could write a server side script to do it. 
I've got one based on Henrik's rootlogin.pl that checks client data
coming in, If it gets a match on the server name it is looking for it
then checks for a process called service.exe. If that is not running it
sends an alert.

I do it this way because I want a custom alert for that issue not just a
process not running alert. 
I'm sure it would be fairly easy to adapt the script to check the total
memory value from a specific server.
-----Original Message-----
From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On
Behalf Of Mark Wagner
Sent: 18 June 2012 08:26
To: xymon at xymon.com
Subject: [Xymon] Triggering on total memory?
quoted from Mark Wagner

One of my servers has a quirk where it will occasionally fail to
detect
two-thirds of its RAM on startup.  Is it possible to set things up to
send an alert if *total* RAM is below a certain amount?

--
Mark Wagner
Name & Registered Office: EXPRESS GIFTS LIMITED, 2 GREGORY ST, HYDE, CHESHIRE, ENGLAND, SK14 4TH, Company No. 00718151.
Express Gifts Limited is authorised and regulated by the Financial Services Authority
NOTE:  This email and any information contained within or attached in a separate file is confidential and intended solely for the Individual to whom it is addressed. The information or data included is solely for the purpose indicated or previously agreed. Any information or data included with this e-mail remains the property of Findel PLC and the recipient will refrain from utilising the information for any purpose other than that indicated and upon request will destroy the information and remove it from their records.  Any views or opinions presented are solely those of the author and do not necessarily represent those of Findel PLC. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. No warranties or assurances are made in relation to the safety and content of this e-mail and any attachments.  No liability is accepted for any consequences arising from it. Findel Plc reserves the right to monitor all e-mail communications through its internal and external networks. If you have received this email in error please notify our IT helpdesk on +44(0) 1254 303030
list Jeremy Laidman · Thu, 28 Jun 2012 19:19:54 +1000 ·
On the server, you can get the total amount of RAM from the "top" client
data like so:

xymon localhost 'clientlog name.of.server section=top' | sed -n '/^Mem:/{s/
total.*$//;s/^.* //;p}'

A client-side script like this should check that the memory is as it should
be:

#!/bin/sh
TEST=ram-check
xymongrep "$TEST:*" | while read LINE; do
  set - ""$LINE; HN="$2"
  [ "$HN" ] || continue
  RAMREQUIRED=`echo "$LINE" | sed "s/^.*${TEST}://;s/ .*$//;s/k$//"`
  HNCOMMAS=`echo "$HN" | sed 's/\./,/g'`
  RAMFOUND=`xymon $XYMSRV "clientlog $HN section=top" | sed -n '/^Mem:/{s/
total.*$//;s/^.* //;s/k$//p}'`
  if [ "$RAMFOUND" -lt "$RAMREQUIRED" ]; then
    COL=red
    MSG="RAM count ${RAMFOUND}kB is less than ${RAMREQUIRED}kB"
  else
    COL=green
    MSG="RAM count ${RAMFOUND}kB is at least ${RAMREQUIRED}kB"
  fi
  echo $XYMON $XYMSRV "status $HNCOMMAS.$TEST $COL `date` $MSG"
done

This script checks any server tagged with "ram-check:NNN" where NNN is a
number of kB" and creates a "ram-check" status page with the result.

J
quoted from Mark Wagner


On Mon, Jun 18, 2012 at 5:25 PM, Mark Wagner <user-faae84d79588@xymon.invalid>wrote:
One of my servers has a quirk where it will occasionally fail to detect
two-thirds of its RAM on startup.  Is it possible to set things up to
send an alert if *total* RAM is below a certain amount?

--
Mark Wagner