Monitor servers

Eliezer Croitoru eliezer at ngtech.co.il
Fri Jul 13 15:36:24 UTC 2012


On 7/13/2012 9:11 AM, L.M.J wrote:
> Le 13/07/2012 07:42, Eliezer Croitoru a écrit :
>> On 7/11/2012 10:23 PM, L.M.J wrote:
>>> Hi,
>>>
>>>    I'm looking for a solution to monitor cpu/disk usage on several
>>> servers and
>>>    it send me an email if there is an alert level reached.
>>>    BUT I'm looking for a autonomous solution, I don't want a
>>> centralized web
>>>    page interface
>
>> you can also use snmp and a simple cronjobs on one centralized
>> machine that will check all the others every 5\10 minutes and will
>> send the results in a case of "warring\critical" state.
>> it's a piece pf cake to put it all together.
>
>
> Hello Eliezer,
>
>    I don't want centralized monitoring, I need a self-sufficient & light
> monitoring tool. My best horse for centralized monitoring is XYmon, I do
> really love it ;)
>
so i'm sorry but you are not clear enough to understand what you are 
seeking for.
you dont need a centralized web interface .. but what you do want?
one machine that will do the checks?
every machine by itself?
if you want one machine that will monitor the others the solution i gave 
you is good.
if no you can just use nagios check plugins to do the tests for you 
inside a cronjob script.

nagios plugins by themselves have good interface to indicate and check 
status by strict defined levels.
they have an exit code for each state...
so just run a nice if else script:
here an example i am using..
##check_icap start
#!/bin/sh
/usr/lib64/nagios/plugins/check_tcp -H 127.0.0.2 -p 1344 >>/dev/null
result=`echo $?`
FILE=/tmp/icapdown

case "$result" in
0)
rm /tmp/icapdown
icap="ok"
;;
*)

if [ ! -f $FILE ];
then
         /scripts/sendmail.sh ICAP
         touch /tmp/icapdown

fi

exit 1
esac
##check_icap end

##sendmail.sh start
#!/bin/bash
USER=desination at email.com
SERVICE=$1
FROM=tester at mail.com
cat << EOF | /usr/sbin/sendmail -f $FROM -t "$USER"
From: tester at mail.com
To: $USER
Subject:#### $SERVICE is down
Content-Type: text/plain; charset=UTF-8
$SERVICE DOWN.
EOF
##sendmail.sh send



-- 
Eliezer Croitoru
https://www1.ngtech.co.il
IT consulting for Nonprofit organizations
eliezer <at> ngtech.co.il






More information about the ubuntu-server mailing list