<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>linsec.ca blog &#187; nagios</title>
	<atom:link href="http://linsec.ca/blog/tag/nagios/feed/" rel="self" type="application/rss+xml" />
	<link>http://linsec.ca/blog</link>
	<description>You can have it right, or you can have it now.  But you can't have it right now.</description>
	<lastBuildDate>Tue, 27 Jul 2010 21:41:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Learning more about Nagios for server monitoring</title>
		<link>http://linsec.ca/blog/2009/01/15/learning-more-about-nagios-for-server-monitoring/</link>
		<comments>http://linsec.ca/blog/2009/01/15/learning-more-about-nagios-for-server-monitoring/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 15:10:29 +0000</pubDate>
		<dc:creator>vdanen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[techmail]]></category>

		<guid isPermaLink="false">http://linsec.ca/blog/?p=367</guid>
		<description><![CDATA[This week&#8217;s TechMail is Learning more about Nagios for server monitoring which reviews the book Learning NAGIOS 3.0 published by Packt Publishing. This is a pretty decent book for anyone interested in learning more about Nagios. It taught me, who&#8217;s been using Nagios for some time, a few new tricks. Not necessarily a good read, [...]]]></description>
			<content:encoded><![CDATA[<p>This week&#8217;s TechMail is <a href="http://blogs.techrepublic.com.com/opensource/?p=320">Learning more about Nagios for server monitoring</a> which reviews the book <i>Learning NAGIOS 3.0</i> published by <a href="http://www.packtpub.com/">Packt Publishing</a>.  This is a pretty decent book for anyone interested in learning more about Nagios.  It taught me, who&#8217;s been using Nagios for some time, a few new tricks.  Not necessarily a good read, but a darn fine reference manual (although reading from front to back would be good for someone who really wants to get up to speed on the full power of Nagios quickly).  Read the TechMail for the full review.</p>
]]></content:encoded>
			<wfw:commentRss>http://linsec.ca/blog/2009/01/15/learning-more-about-nagios-for-server-monitoring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>hddtemp wrapper for Nagios</title>
		<link>http://linsec.ca/blog/2008/02/09/hddtemp-wrapper-for-nagios/</link>
		<comments>http://linsec.ca/blog/2008/02/09/hddtemp-wrapper-for-nagios/#comments</comments>
		<pubDate>Sat, 09 Feb 2008 07:52:50 +0000</pubDate>
		<dc:creator>vdanen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mandriva]]></category>
		<category><![CDATA[hddtemp]]></category>
		<category><![CDATA[nagios]]></category>

		<guid isPermaLink="false">http://linsec.ca/blog/2008/02/09/hddtemp-wrapper-for-nagios/</guid>
		<description><![CDATA[I was bored tonight so I wrote a wrapper for hddtemp for Nagios monitoring. I have a bit of a quirky setup for Nagios where I run the local system checks on remote systems via netcat, ipsvd, and a script to handle the query. This allows me to monitor remote drive space, current users, total [...]]]></description>
			<content:encoded><![CDATA[<p>I was bored tonight so I wrote a wrapper for hddtemp for Nagios monitoring.  I have a bit of a quirky setup for Nagios where I run the local system checks on remote systems via netcat, ipsvd, and a script to handle the query.  This allows me to monitor remote drive space, current users, total processes, and current load.  Using hddtemp, I can now monitor the temperature of the drives in those machines (which also gives me an idea of how hot/cold the server room itself is).</p>
<p>This may need some tweaking to work with other Nagios setups, but shouldn&#8217;t be too hard to adapt.  One of these days I&#8217;ll do a writeup on my Nagios configuration.  Anyways, the wrapper script is as follows.  It could probably be optimized a bit more, but it works well enough.  WordPress doesn&#8217;t handle the indents very well, so keep that in mind.</p>
<p><code><br />
#!/bin/sh</p>
<p>usage() {<br />
    echo "${0} -w [warn] -c [crit] [drives]"<br />
}</p>
<p>if [ "${1}" == "-h" -o "${1}" == "--help" ]; then<br />
    usage<br />
    exit 0<br />
fi<br />
if [ "${1}" == "-w" ]; then<br />
    shift<br />
    warn="${1}"<br />
    shift<br />
else<br />
    usage<br />
    exit 1<br />
fi<br />
if [ "${1}" == "-c" ]; then<br />
    shift<br />
    crit="${1}"<br />
    shift<br />
else<br />
    usage<br />
    exit 1<br />
fi<br />
while [ "${1}" != "" ]; do<br />
    drives="${drives} ${1}"<br />
    shift<br />
done<br />
if [ "${drives}" == "" ]; then<br />
    usage<br />
    exit 1<br />
fi</p>
<p>status=0<br />
smsg=""<br />
htemp=0</p>
<p>for drive in ${drives}; do<br />
    msg=""<br />
    stats=`/usr/local/sbin/hddtemp ${drive}`<br />
    model=`echo ${stats} | cut -d ':' -f 2`<br />
    temp=`echo ${stats} | cut -d ':' -f 3 | cut -d ' ' -f 2`<br />
    dev=`echo ${drive}|cut -d '/' -f 3`</p>
<p>    if [ "${temp}" -ge "${warn}" ]; then<br />
        if [ "${status}" != "2" ]; then<br />
            status=1<br />
        fi<br />
    fi</p>
<p>    if [ "${temp}" -ge "${crit}" ]; then<br />
        status=2<br />
    fi</p>
<p>    if [ "${temp}" -gt "${htemp}" ]; then<br />
        htemp="${temp}"<br />
    fi</p>
<p>    smsg="${smsg}${dev}=${temp}C; "<br />
done</p>
<p>case "${status}" in<br />
    2)<br />
        wmsg="CRITICAL"<br />
        ;;<br />
    1)<br />
        wmsg="WARN"<br />
        ;;<br />
    0)<br />
        wmsg="OK"<br />
        ;;<br />
esac</p>
<p>echo "HDDTEMP ${wmsg} - ${smsg}|hddtemp=${htemp};${warn};${crit};0"<br />
</code></p>
<p>The output, in Nagios&#8217; status view looks like:</p>
<p><code><br />
HDDTEMP OK - hda=22C: sda=24C: sdb=24C:<br />
</code></p>
<p>It&#8217;s called as &#8220;hddtemp-mon -w 30 -c 35 /dev/hda /dev/sda /dev/sdb&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://linsec.ca/blog/2008/02/09/hddtemp-wrapper-for-nagios/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
