Re: Monitoring softraids
Alexander Finger <af <at> genevainformation.ch>
2012-08-21 13:13:08 GMT
You need to change the format to correspond to what snmp expects as a table format.
Saying "snmp data" is absolutely correct. The script returns a string. In Nagios, you can then split() the string and use the data. That permits you to pack several values in such a string. SNMP, however, uses tables to represent such a structure, and not split().
However - can you not derive a script from the example?
alex
On Tue, Aug 21, 2012 at 3:00 PM, Fuhrmann, Marcel
<Marcel.Fuhrmann <at> lux.ag> wrote:
I found this script. But how do get this “snmp data” into OpenNMS?
http://ticktoo.com/blog/34-Software+Raid+Monitoring+via+Nagios-SNMP
Von: Umberto Nicoletti [mailto:umberto.nicoletti <at> gmail.com]
Gesendet: Freitag, 17. August 2012 21:48
An: General OpenNMS Discussion
Betreff: Re: [opennms-discuss] Monitoring softraids
You could also configure mdadm to log a message when it detects something interesting and then relay that message into opennms via syslog.
Umberto
On Thursday, August 16, 2012, Fuhrmann, Marcel wrote:
Afaik mdadm can send emails when an error occours. Opennms can watch over pop3/imap accounts. So this could be another solution.
Maybe it is possible to send a snmp trap when a raid is faulty?
Von meinem iPhone gesendet
Am 16.08.2012 um 18:33 schrieb "John A. Sullivan III" <jsullivan <at> opensourcedevel.com>:
> On Thu, 2012-08-16 at 15:26 +0000, Fuhrmann, Marcel wrote:
>> Hello!
>>
>>
>>
>> I could write a bash script to watch for the up status [UUU] from:
>>
>> <snip>
>>
>> and use the send-event.pl script to create an event. Does anybody know
>> a better solution for monitoring a softraid?
>>
>> Can OpenNMS handle this without an external script?
>>
> <snip>
> That's how we do it:
>
> #!/bin/bash
> # We always exit 0 because a failure of this test does not indicate an outage and thus should not degrade uptime statistics
> # We do generate alarm generating events on failure
> SEVENT="/opt/opennms/bin/send-event.pl"
> UEI="uei.mycompany.com/node/"
> SERVICE="-s MDRAID"
> SEV="-x 5" # Minor severity
> HOST=${2}
> TMOUT=${4}
> #NID="-n ${5}"
> NID="-n $(psql -U onmsuser -h
pgsql.mycompany.com -qtAc "select nodeid from ipinterface where ipaddr='${HOST}';" onms)"
> PORT=${5:-22}
> IFSORIG=${IFS}
> IFS=$'\n'
> declare -a OUTPUT
> INPUT=($(ssh -p ${PORT} -o ConnectTimeout=${TMOUT} ${HOST} "cat /proc/mdstat" 2>/dev/null))
> if [ $? -ne 0 ];then
> eval ${SEVENT} ${UEI}MDRAIDTestFailed ${NID} ${SERVICE} ${SEV}
> exit 0
> fi
> IFS=${IFSORIG}
> c=0
> while [ -n "${INPUT[${c}]}" ]
> do
> if [ "${INPUT[${c}]:0:2}" = "md" ];then
> ((c = c + 1))
> if [ -n "$(echo ${INPUT[${c}]} | grep -P '.* \[[[:alpha:]_]*_[[:alpha:]_]*\]')" ];then
> eval ${SEVENT} ${UEI}MDRAIDDegraded ${NID} ${SERVICE} ${SEV} -p \"device ${INPUT[((${c} - 1))]%% *}\"
> fi
> fi
> ((c = c + 1))
> done
> exit 0
>
> We then have a script launched from the Destination Paths which tries to
> automatically fix the problem and then calls in humans if that fails.
> I'd be very interested in a better way - John
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats.
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Please read the OpenNMS Mailing List FAQ:
> http://www.opennms.org/index.php/Mailing_List_FAQ
>
> opennms-discuss mailing list
>
> To *unsubscribe* or change your subscription options, see the bottom of this page:
>
https://lists.sourceforge.net/lists/listinfo/opennms-discuss
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats.
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ
opennms-discuss mailing list
To *unsubscribe* or change your subscription options, see the bottom of this page:
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ
opennms-discuss mailing list
To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-discuss
--
FR: +33658191386
CH: +41795921792
First Person - is it a game or reality? Order now:
https://www.createspace.com/3709749Enter discount code GDCQQ328 for 10% friends & family discount!
Netzwerkmanagement mit OpenNMS:
http://www.dpunkt.de/buecher/3194.html
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ
opennms-discuss mailing list
To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-discuss