<?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>An It-Slave in the digital saltmine &#187; graph</title>
	<atom:link href="http://www.it-slav.net/blogs/category/graph/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.it-slav.net/blogs</link>
	<description>Another Blog from a Geek that has no life</description>
	<lastBuildDate>Fri, 02 Jul 2010 07:33:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Book review &#8220;Cacti 0.8 Network Monitoring, Monitor your network with ease!&#8221;</title>
		<link>http://www.it-slav.net/blogs/2009/09/21/book-review-cacti-0-8-network-monitoring-monitor-your-network-with-ease/</link>
		<comments>http://www.it-slav.net/blogs/2009/09/21/book-review-cacti-0-8-network-monitoring-monitor-your-network-with-ease/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 19:50:49 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Geek stuff]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[op5 Statistics]]></category>

		<guid isPermaLink="false">http://www.it-slav.net/blogs/?p=1351</guid>
		<description><![CDATA[
&#160;
&#160;
I have read the book &#34;Cacti 0.8 Network Monitoring, Monitor your network with ease!&#34; by Dinangkur Kundu and S.M.Ibrahim Lavlu. The book is 116 pages.
&#160;
According to the book the target audience for this book is for anyone who wants to manage a network using Cacti. To read the book you do not need to be [...]]]></description>
			<content:encoded><![CDATA[<p><img height="617" width="500" class="aligncenter size-full wp-image-1356" title="cacti-larger" alt="cacti-larger" src="http://www.it-slav.net/blogs/wp-content/uploads/2009/09/cacti-larger.jpg" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>I have read the book &quot;Cacti 0.8 Network Monitoring, Monitor your network with ease!&quot; by Dinangkur Kundu and S.M.Ibrahim Lavlu. The book is 116 pages.</p>
<p>&nbsp;</p>
<p>According to the book the target audience for this book is for anyone who wants to manage a network using Cacti. To read the book you do not need to be a Linux Guru. And I&nbsp;agree, even if it probably helps if you have basic knowledge of Linux/UNIX, RRD, MySQL and SNMP.</p>
<p>&nbsp;</p>
<p>Many of the OpenSource software projects out there is excellent but usually require a rather skilled person or a very interested person with alot of time to start working. Downloading the software and start reading the manual that comes with the software is often quite hard and a book like this narrow that gap and make a complex software like Cacti easier to use.</p>
<p>&nbsp;<span id="more-1351"></span></p>
<p>I find the Cacti GUI sometimes very cumbersome and this book, with its step by step guides to setup, makes graphing of network attached devices easy. The book explains how Cacti works and the underlaying technology like RRD well. RRD is the excellent Round Robin Database and tool and it is created by Tobias Oetiker. What I&#8217;m lacking is that when it has described the basics, it stops.&nbsp; I would really like a deeper explanation of RRD because Cacti is a graphing tool which uses RRD and a deeper knowledge of RRD would make your graphs better and give you the information you want.</p>
<p>I also lack the deeper explanation of advanced Cacti topics like SNMP query XML syntax and other topics.The book is only 116 pages and in my opinion the book would be much more valuable if 50 extra pages would have been used to dig deeper into more advanced topics and explain more extensive what al the options in Cacti means.</p>
<p>I&nbsp;really miss a howto for Cacti addons like wethermaps, weathermaps is taking Cacti another step in visualiation of complex data.</p>
<p>&nbsp;</p>
<p>I would recommend this book for newbies into Cacti that will get ther first graphs implementation a boost, for anyone that has used Cacti I would go for the RRD homepage, Cacti homepage and Cacti forums, blogs and other sources on internet.</p>
<p>&nbsp;</p>
<h2>Links:</h2>
<ul>
<li>To buy the book <a href="http://www.packtpub.com/cacti-0-8-network-monitoring/mid/260809mw25cy?utm_source=It-Slav.net&amp;utm_medium=affiliate&amp;utm_content=other&amp;utm_campaign=mdb_000376">Cacti 0.8 Network Monitoring, Monitor your network with ease!</a></li>
<li>An example <a href="http://www.packtpub.com/files/5968-cacti-sample-chapter-4-creating-and-using-templates.pdf">Chapter 4, creating and using templates</a></li>
<li>Cacti <a href="http://www.cacti.net/" target="_blank">homepage</a></li>
<li>Cacti <a href="http://forums.cacti.net/" target="_blank">Forum</a></li>
<li><a href="http://oss.oetiker.ch/rrdtool/" target="_blank">RRD tools</a></li>
<li><a href="http://www.op5.com/op5/products/statistics" target="_blank">op5 Statistics</a>, a supported version of Cacti</li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.it-slav.net/blogs/2009/09/21/book-review-cacti-0-8-network-monitoring-monitor-your-network-with-ease/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Network outage for it-slav.net</title>
		<link>http://www.it-slav.net/blogs/2009/09/07/network-outage-for-it-slav-net/</link>
		<comments>http://www.it-slav.net/blogs/2009/09/07/network-outage-for-it-slav-net/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 19:44:49 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[it-slav.net]]></category>

		<guid isPermaLink="false">http://www.it-slav.net/blogs/?p=1294</guid>
		<description><![CDATA[At 4.30 CET I&#160; lost my internet connection and 9.30 CET it was back. After that it was flapping up and down for a couple of hours. My ISP is Bredbandsbolaget and I&#160;continusly looked at their so called maintenance site. Not a word about the disturbance. It really annoys me that there was no information [...]]]></description>
			<content:encoded><![CDATA[<p>At 4.30 CET I&nbsp; lost my internet connection and 9.30 CET it was back. After that it was flapping up and down for a couple of hours. My ISP is Bredbandsbolaget and I&nbsp;continusly looked at their so called maintenance site. Not a word about the disturbance. It really annoys me that there was no information what so ever, I tried to call them and gave up after 20 minutes of &quot;thanks for your patience&quot; in my ear. I tried to send an email and got an automated answer saying that they will come back to me in a couple of days. Yes days!!</p>
<p>&nbsp;</p>
<p>I&nbsp;know for sure that the problems was not on my side, because a friends friend that lives in the same area had the same problem.</p>
<p>&nbsp;</p>
<p>This graph shows the packet lost when pinging the closest router:</p>
<p><img height="193" width="597" src="http://www.it-slav.net/blogs/wp-content/uploads/2009/09/firstrouterautage.png" alt="firstrouterautage" title="firstrouterautage" class="aligncenter size-full wp-image-1295" /></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.it-slav.net/blogs/2009/09/07/network-outage-for-it-slav-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nordic meet on Nagios is over.</title>
		<link>http://www.it-slav.net/blogs/2009/06/04/nordic-meet-on-nagios-is-over/</link>
		<comments>http://www.it-slav.net/blogs/2009/06/04/nordic-meet-on-nagios-is-over/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 17:51:00 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Hints]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[op5]]></category>

		<guid isPermaLink="false">http://www.it-slav.net/blogs/?p=1123</guid>
		<description><![CDATA[It has been very interesting and two intensive days. The highlights IMHO:

Tobias Oitiker gave a very good presentation about the linux kernel caching and described how it affected RRDtools.
Markus Almroth, describes Sysnagios which did the opposite of most monitoring projects. Sysnagios decentralized the configuration of systems and network monitoring in a controlled way. I will [...]]]></description>
			<content:encoded><![CDATA[<p>It has been very interesting and two intensive days. The highlights IMHO:</p>
<ul>
<li>Tobias Oitiker gave a very good presentation about the linux kernel caching and described how it affected <a href="http://oss.oetiker.ch/rrdtool/" target="_blank">RRDtools</a>.</li>
<li>Markus Almroth, describes Sysnagios which did the opposite of most monitoring projects. Sysnagios decentralized the configuration of systems and network monitoring in a controlled way. I will come back to this topic in my blog.</li>
<li>Per Åsberg talked about <a href="http://www.op5.org/community/projects/ninja" target="_blank">Ninja</a>, a new GUI for Nagios, done by op5.</li>
<li>Andriy Skuratov, talked about and demonstrated a new version of Nagvis with integrated Google Maps and other good stuff.</li>
<li>Ethan Galstad the founder of Nagios announced Ninja as the new GUI for Nagios.</li>
</ul>
<p>During the Nordic meet on Nagios I meet alot of interesting people, learned alot and had good food and drinks.</p>
<p>I hope to see you next year at Nordic Meet on Nagios 2010!!!</p>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.it-slav.net/blogs/2009/06/04/nordic-meet-on-nagios-is-over/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress monitoring with Nagios or op5 Monitor using Webinject</title>
		<link>http://www.it-slav.net/blogs/2009/03/16/wordpress-monitoring-with-nagios-or-op5-monitor-using-webinject/</link>
		<comments>http://www.it-slav.net/blogs/2009/03/16/wordpress-monitoring-with-nagios-or-op5-monitor-using-webinject/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 19:18:39 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Nagios]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[op5 Monitor]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[webinject]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.it-slav.net/blogs/?p=862</guid>
		<description><![CDATA[There are several ways of monitor a wordpress blog by using Nagios or op5 Monitor.
Wordpress uses the following parts to work:

Webserver frontend
PHP scripts
MySQL database backend
At least one system to run it on

I found one article describing howto monitor the Webserver and the MySQL database and even that a certain webpage contain a certain phrase. But [...]]]></description>
			<content:encoded><![CDATA[<p>There are several ways of monitor a wordpress blog by using Nagios or op5 Monitor.</p>
<p>Wordpress uses the following parts to work:</p>
<ul>
<li>Webserver frontend</li>
<li>PHP scripts</li>
<li>MySQL database backend</li>
<li>At least one system to run it on</li>
</ul>
<p>I found one <a href="http://www.linickx.com/archives/271/how-to-monitor-wordpress-with-nagios" target="_blank">article</a> describing howto monitor the Webserver and the MySQL database and even that a certain webpage contain a certain phrase. But I would like to emulate a user that clicks on some pages and graph the performance.</p>
<p>The tool I like for in-depth web monitoring is <a href="http://www.webinject.org/" target="_blank">webinject</a>. It allows scripting a simulated web user with alot of features.</p>
<p>I recommend to read the excellent <a href="http://www.op5.com/support/documentation/how-to/38-monitoring-websites-with-webinject" target="_blank">how-to</a> written by op5 support team and of cource use webinjects <a href="http://www.webinject.org/manual.html" target="_blank">reference manual</a>.</p>
<p><span id="more-862"></span></p>
<p>The testcase I&#8217;ve created looks like this:</p>
<pre>&lt;testcases repeat="1"&gt;
&lt;case
    id="1"
    description1="Startsidan www.it-slav.net/blogs"
    method="get"
    url="http://www.it-slav.net/blogs/"
    verifypositive="An It-Slave in the digital saltmine"
/&gt;
&lt;case
    id="2"
    description1="Nagios or op5 Monitor plugin for 1-wire humidity measurement"
    method="get"
    url="http://www.it-slav.net/blogs/?p=802"
    verifypositive="1-wire humidity probe"
/&gt;
&lt;case
    id="3"
    description1="op5 Monitor or Nagios plugin for 1-wire temperature measurement"
    method="get"
    url="http://www.it-slav.net/blogs/?p=115"
    verifypositive="check_1-wiretemp"
/&gt;
&lt;case
    id="4"
    description1="Wp-Admin"
    method="get"
    url="http://www.it-slav.net/blogs/wp-admin"
    verifyresponsecode="301"
/&gt;
&lt;/testcases&gt;
</pre>
<p>And when run in Nagios mode:</p>
<pre>[root@op5 webinject]# ./webinject.pl -c config.xml testcases/wordpressblog.xml
WebInject OK - All tests passed successfully in 4.143 seconds |time=4.143;10;;0
</pre>
<p>In checkcommands.cfg:</p>
<pre># command 'check_webinject'
define command{
    command_name                   check_webinject
    command_line                   $USER1$/webinject/webinject.pl testcases/$ARG1$
    }

In services.cfg:</pre>
<pre># service 'Webinject Blog'
define service{
    use                            default-service
    host_name                      dull
    service_description            Webinject Blog
    check_command                  check_webinject!wordpressblog.xml
    contact_groups                 it-slav_sms,it-slav_mail,call_it-slav
    }
</pre>
<p><br class="spacer_" /></p>
<p>This is a nice pnp graph of my Webinject check:</p>
<p><img class="aligncenter size-full wp-image-896" title="dull_webinject_blog" src="http://www.it-slav.net/blogs/wp-content/uploads/2009/03/dull_webinject_blog.png" alt="dull_webinject_blog" width="620" height="264" /></p>
<h2>Links:</h2>
<ul>
<li><a href="http://www.webinject.org/" target="_blank">Webinject</a></li>
<li>op5 Webinject <a href="http://www.op5.com/support/documentation/how-to/38-monitoring-websites-with-webinject" target="_blank">Howto</a></li>
<li><a href="http://www.nagios.org" target="_blank">Nagios</a></li>
<li><a href="http://www.op5.com/op5/products/monitor" target="_blank">op5 Monitor</a> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.it-slav.net/blogs/2009/03/16/wordpress-monitoring-with-nagios-or-op5-monitor-using-webinject/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nagios or op5 Monitor plugin for 1-wire humidity measurement</title>
		<link>http://www.it-slav.net/blogs/2009/02/25/nagios-or-op5-monitor-plugin-for-1-wire-humidity-measurement/</link>
		<comments>http://www.it-slav.net/blogs/2009/02/25/nagios-or-op5-monitor-plugin-for-1-wire-humidity-measurement/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 18:46:35 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[1-wire]]></category>
		<category><![CDATA[Cool things]]></category>
		<category><![CDATA[Geek stuff]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[op5 Monitor]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[Nagios lugin humidity]]></category>

		<guid isPermaLink="false">http://www.it-slav.net/blogs/?p=802</guid>
		<description><![CDATA[
This article describe howto get a 1-wire humidity probe to work with Nagios or op5 Monitor.
In an earlier article I have described a 1-wire temperature plugin.


Pre requriments
To get it working you need:

1-wire humidity probe i.e. this, it is based on  DS2438 &#38; HIH-4000
A working owfs installation, instructions can be found here 
Nagios or op5 [...]]]></description>
			<content:encoded><![CDATA[<p><br class="spacer_" /></p>
<p>This article describe howto get a 1-wire humidity probe to work with Nagios or op5 Monitor.</p>
<p>In an earlier article I have described a <a href="http://www.it-slav.net/blogs/?p=115" target="_blank">1-wire temperature plugin</a>.</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h2>Pre requriments</h2>
<p>To get it working you need:</p>
<ul>
<li>1-wire humidity probe i.e. <a href="https://shop.temperatur.nu/luftfuktighetsmatare-for-1wire-p-72.html?osCsid=cb8ce34ce11b4856fb5fc8134ba52cc4" target="_blank">this</a>, it is based on  DS2438 &amp; HIH-4000</li>
<li>A working <a href="http://www.owfs.org/" target="_blank">owfs</a> installation, instructions can be found <a href="http://www.it-slav.net/blogs/?p=67" target="_blank">here</a> </li>
<li><a href="http://www.nagios.org" target="_blank">Nagios</a> or <a href="http://www.op5.com/op5/products/monitor" target="_blank">op5 Monitor</a></li>
</ul>
<p><span id="more-802"></span></p>
<p><br class="spacer_" /></p>
<h2>check_1-wirehumid</h2>
<p>The plugin is written in perl and version 1.0 can be downloaded <a href="http://www.it-slav.net/~peter/check_1-wirehumid/version-1.0/" target="_blank">here</a></p>
<pre>#!/usr/bin/perl -w
#
# Check humidity of 1Wire device
# Requires use of Fuse and owfs
#
#
# By Peter Andersson
# peter@it-slav.net
# http://www.it-slav.net/blogs/?p=802
# Licence GPLv2
# Version 1.0

use strict;
use Getopt::Std;
use OW;

my $owserver = "127.0.0.1:3001";
my(%ERRORS) = ( OK=&gt;0, WARNING=&gt;1, CRITICAL=&gt;2, UNKNOWN=&gt;3 );

my $humidity;
my $status=$ERRORS{OK};;
my $message;

my $debug_flag=0;

our($opt_c, $opt_w, $opt_W, $opt_C, $opt_h, $opt_o, $opt_i);

getopts("w:W:c:C:ho:i:");

sub printhelp () {
	print "Usage: check_1-wirehumid [-h] -c lowhumidcritical -w lowhumidwarning -W highhumidwarning -C highhumidcritical -i id [-o owserver:port]\n";
	print "-h Help, this text\n-c num Critical threshold for low humidity\n-w num Warning threshold for low humidity\n";
	print "-W num Warning threshold for high humidity\n-C num Critical threshold for high humidity\n";
	print "-o &lt;name|ip&gt;:port, Servername of 1-wire server and portnumber the owserver use, default 127.0.0.1:3001\n";
	print "-i 1-wire ID, i.e. 10.DEF05F01080015\n";
	print "\n\t\tby Peter Andersson\n\t\tpeter\@it-slav.net\n\t\thttp://www.it-slav.net/blogs/?p=802\n";
	exit $status;
}

#sanity check
if (!$opt_c||!$opt_w||!$opt_W||!$opt_C||$opt_h) {
	$status= $ERRORS{UNKNOWN};
	&amp;printhelp;
} elsif ($opt_c &gt; $opt_w) {
	print "Critical low threshold must be higher or equal to warning low threshold\n";
	$status= $ERRORS{UNKNOWN};
	&amp;printhelp;
} elsif ($opt_w &gt; $opt_W || $opt_c &gt; $opt_C) {
	print "Lower tresholds must be lower then higher thresholds\n";
	$status= $ERRORS{UNKNOWN};
	&amp;printhelp;
} elsif ($opt_C &lt; $opt_W) {
	print "Higher critical threshold must be higher or equal to higher warning threshold\n";
	$status= $ERRORS{UNKNOWN};
	&amp;printhelp;
}

if ($opt_o) {
	$owserver = $opt_o;
}

unless(OW::init($owserver)) {
	$status = $ERRORS{CRIT};
	$message = "OWServer not running at $owserver\n";
	exit $status;
}
$humidity = OW::get("$opt_i/humidity");
$humidity =~ s/^\s*(.*?)\s*$/$1/; #remove whitespaces
unless (($humidity =~ /^-?(?:\d+(?:\.\d*)?|\.\d+)$/) || ($humidity =~ /^[+-]?\d+$/)) #check that it is an integer or decimal returned
{
	$message="Did not got an integer or a decimal from humidity probe";
        $status=$ERRORS{CRITICAL};
}
$humidity = sprintf("%.0f", $humidity);

if ($debug_flag) {
	print "opt_c:$opt_c opt_w:$opt_w opt_W:$opt_W opt_C:$opt_C opt_h:$opt_h owserver:$owserver opt_i:$opt_i Humidity:$humidity\n";
}

if ($humidity &lt;= $opt_c) {
	$status=$ERRORS{CRITICAL};
	$message="CRITICAL";
} elsif ($humidity &gt; $opt_c &amp;&amp; $humidity &lt;= $opt_w) {
	$status=$ERRORS{WARNING};
	$message="WARNING";
} elsif ($humidity &gt;  $opt_w &amp;&amp; $humidity &lt;  $opt_W) {
	$status=$ERRORS{OK};
	$message="OK";
} elsif ($humidity &gt;= $opt_W &amp;&amp; $humidity &lt; $opt_C) {
	$status=$ERRORS{WARNING};
	$message="WARNING";
} elsif ($humidity &gt;= $opt_C) {
	$status=$ERRORS{CRITICAL};
	$message="CRITICAL";
} else { #This should never happend
	$status=$ERRORS{UNKNOWN};
	$message="UNKNOW";
}

print "$message: $humidity \%\|humidity=$humidity\%\;$opt_c;$opt_w;$opt_W;$opt_C\n";
exit $status;
</pre>
<p><br class="spacer_" /></p>
<p>Test the plugin by run:</p>
<pre>[root@op5 custom]# ./check_1-wirehumid -c 10 -w 20 -W 90 -C 95 -i 26.D7EABC000000
OK: 31 %|humidity=31%;10;20;90;95
</pre>
<p>So I have 31 % humidity.</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h2>Nagios config files</h2>
<p>In checkcommands.cfg, define check_1-wirehumid</p>
<pre># command 'check_1-wirehumid'
define command{
    command_name                   check_1-wirehumid
    command_line                   $USER1$/custom/check_1-wirehumid -c $ARG1$ -w $ARG2$ -W$ARG3$ -C$ARG4$ -i $ARG5$ -o $ARG6$
    }
</pre>
<p>In serviced.cfg, define the check. I have a service group called Environemnt where all my Environments probes are.</p>
<pre># service 'Washroom Humidity'
define service{
    use                            default-service
    host_name                      monitor
    service_description            Washroom Humidity
    check_command                  check_1-wirehumid!10!20!80!90!26.D7EABC000000!127.0.0.1:3001
    servicegroups                  Environment
    contact_groups                 it-slav_msn,it-slav_mail,call_it-slav
    }
</pre>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h2>Screenshots</h2>
<p><a href="http://www.it-slav.net/blogs/wp-content/uploads/2009/02/environmentservicegroup.png"><img class="alignnone size-full wp-image-808" title="environmentservicegroup" src="http://www.it-slav.net/blogs/wp-content/uploads/2009/02/environmentservicegroup.png" alt="" width="777" height="147" /></a></p>
<p>This is a screen shoot from op5 Monitor showing my Servicegroup Environment.</p>
<p><br class="spacer_" /></p>
<p><a href="http://www.it-slav.net/blogs/wp-content/uploads/2009/02/humidity.png"><img class="alignnone size-full wp-image-809" title="humidity" src="http://www.it-slav.net/blogs/wp-content/uploads/2009/02/humidity.png" alt="" width="583" height="531" /></a></p>
<p>If you have op5 Monitor or PNP for Nagios, graphs like this will automatically be created. Note that I had a shower 6.20 and the humidity went from approx 25% to 95% in a couple of minutes.<br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.it-slav.net/blogs/2009/02/25/nagios-or-op5-monitor-plugin-for-1-wire-humidity-measurement/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Stock graphs</title>
		<link>http://www.it-slav.net/blogs/2008/12/11/stock-graphs/</link>
		<comments>http://www.it-slav.net/blogs/2008/12/11/stock-graphs/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 21:35:51 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Geek stuff]]></category>
		<category><![CDATA[Hints]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[getting rich]]></category>
		<category><![CDATA[stock graphs]]></category>
		<category><![CDATA[stocks]]></category>

		<guid isPermaLink="false">http://www.it-slav.net/blogs/?p=77</guid>
		<description><![CDATA[As everybody else I&#8217;m dreaming of getting rich. I live in Sweden, the country with the highest taxes in the world so getting rich by working is impossible. One way of getting rich is winning a lottery and probably the only social accepted way of getting rich in Sweden.
One way of getting rich is buying [...]]]></description>
			<content:encoded><![CDATA[<p>As everybody else I&#8217;m dreaming of getting rich. I live in Sweden, the country with the highest taxes in the world so getting rich by working is impossible. One way of getting rich is winning a lottery and probably the only social accepted way of getting rich in Sweden.</p>
<p>One way of getting rich is buying the correct stock at the right time and price, and sell it after a while for much more. The chance of picking the ultimate stock is very low and I think it can be compared to winning a lottery. The probability of picking a not very bad stock at not that very bad time is higher if you have some knowledge and uses some tools.</p>
<p>I&#8217;m a computer geek that totally failed to study Economics at the university (I did that in parallel with my Master Of Science studies) mainly because it was not science, it was more of black magic.</p>
<p>So the conclusion is that I probably will not get rich by my knowledge in Economy but why not try to do it more fun by creating my own <a target="_blank" href="http://www.it-slav.net/~peter/stocks/">graphs</a> of stock values:-)</p>
<pre>
#!/usr/bin/perl
#Script that graphs some stocks
#peter@it-slav.net
use RRDs;
use Finance::YahooQuote;
$Finance::YahooQuote::TIMEOUT = 60;
useExtendedQueryFormat();

my @symbols=('SWEDA.ST', 'CLASB.ST', 'AXIS.ST', &quot;NOVL&quot;, 'ERICB.ST', &quot;INVEB.ST&quot;, &quot;\^OMXSPI&quot; );

my $rrd = '/var/rrd_db/stocks';
# define location of images
my $img = '/home/peter/public_html/stocks';

my $cur_time = time();                # set current time
my $end_time = $cur_time ;     # set end

#$value=int(rand(1000));

foreach (@symbols) {
        @quote = getonequote (&quot;$_&quot;); # Get a quote for a single symbol
        #print&quot;@quote\n&quot;;
        $quote[0]=&amp;trim($quote[0]);
        print &quot;Ticker:$quote[0]\tName:$quote[1]\tLast_price:$quote[2]\t50d_Mov_Avg:$quote[35]\n&quot;;
        if ($quote[35] eq &quot;N/A&quot;) {
                $quote[35]=0;
        }

        #&amp;graph (ticket,description,price,movingavarage-50-days)
        &amp;graph ($quote[0],$quote[1],$quote[2],$quote[35]);
}

sub graph
{

        # if rrdtool database doesn't exist, create it
        if (! -e &quot;$rrd/stock$_[0].rrd&quot;)
        {
                print &quot;creating rrd database for stock $_[0]...\n&quot;;
                RRDs::create &quot;$rrd/stock$_[0].rrd&quot;,
                        &quot;-s 86400&quot;, #1 day = 24h/day*60min/h*60sec/min= 86400 sec/day
                        &quot;DS:price:GAUGE:172800:U:U&quot;, #Heartbeat 2 days = 172800 sec
                         &quot;RRA:AVERAGE:0.5:1:365&quot;, #1 year 365 days
                         &quot;RRA:AVERAGE:0.5:1:3650&quot;, #10 years 10*365=3650
                        &quot;DS:movingavarage:GAUGE:172800:U:U&quot;, #Heartbeat 2 days = 172800 sec
                         &quot;RRA:AVERAGE:0.5:1:365&quot;, #1 year 365 days
                         &quot;RRA:AVERAGE:0.5:1:3650&quot;; #10 years 10*365=3650

        }
        if ($ERROR = RRDs::error) { print &quot;$0: failed to create $_[0] database file: $ERROR\n&quot;; }

        # insert values into rrd
        #print &quot;Insert:$_[2]:$_[3] into $rrd/mail$_[0].rrd\n&quot;;
        RRDs::update &quot;$rrd/stock$_[0].rrd&quot;,
                        &quot;-t&quot;, &quot;price:movingavarage&quot;,
                        &quot;N:$_[2]:$_[3]&quot;;
        if ($ERROR = RRDs::error) { print &quot;$0: failed to insert $_[0] data into rrd: $ERROR\n&quot;; }

        #print &quot;$_[0], \&quot;year\&quot;, $_[2], $start_time_year, $_[3], $_[1]\n&quot;;
        #SWEDA.ST, &quot;year&quot;, 75.75, 1193058922, 127.669, SWEDBANK -A-
        if ($_[3] != 0 ) {
                &amp;CreateGraph($_[0], &quot;year&quot;, $start_time_year, &quot;Aktie:$_[1] Ticker:$_[0]&quot;);
        } else {
                &amp;CreateGraphLight($_[0], &quot;year&quot;, $start_time_year, &quot;Aktie:$_[1] Ticker:$_[0]&quot;);
        }
        #&amp;CreateGraph($_[0], &quot;decade&quot;, $start_time_decade, $_[1]);

}

sub CreateGraph
{
# creates graph
# inputs: $_[0]: ticketname
#         $_[1]: interval (ie, day, week, month, year)
#         $_[2]: starttime
#         $_[3]: Full name

        RRDs::graph &quot;$img/stocks$_[0]-$_[1].png&quot;,
#                &quot;-s -1$_[1]&quot;,
                &quot;-t $_[3]&quot;,
#                &quot;--lazy&quot;,
                &quot;--start=$_[2]&quot;,
                &quot;--end=$end_time&quot;,
                &quot;-h&quot;, &quot;500&quot;, &quot;-w&quot;, &quot;1100&quot;,
                &quot;-a&quot;, &quot;PNG&quot;,
                &quot;-v It-Slav.Net&quot;,
                &quot;--slope-mode&quot;,
                &quot;DEF:price=$rrd/stock$_[0].rrd:price:AVERAGE&quot;,
                &quot;LINE2:price#FF0000:Kurs:&quot;,
                &quot;DEF:movingavarage=$rrd/stock$_[0].rrd:movingavarage:AVERAGE&quot;,
                &quot;LINE1:movingavarage#0000FF:Medelvarde 50 dagar:&quot;,
                &quot;GPRINT:price:MIN:  Min\\: %6.lf&quot;,
                &quot;GPRINT:price:MAX:  Max\\: %6.lf&quot;,
                &quot;GPRINT:price:AVERAGE: Avarage\\: %6.lf&quot;,
                &quot;GPRINT:price:LAST: Last\\: %6.lf $_[0]\\n&quot;;
        if ($ERROR = RRDs::error) { print &quot;$0: unable to generate graph $_[0] $_[1] graph: $ERROR\n&quot;; }
}

sub CreateGraphLight
{
# creates graph
# inputs: $_[0]: ticketname
#         $_[1]: interval (ie, day, week, month, year)
#         $_[2]: starttime
#         $_[3]: Full name

        RRDs::graph &quot;$img/stocks$_[0]-$_[1].png&quot;,
#                &quot;-s -1$_[1]&quot;,
                &quot;-t $_[3]&quot;,
#                &quot;--lazy&quot;,
                &quot;--start=$_[2]&quot;,
                &quot;--end=$end_time&quot;,
                &quot;-h&quot;, &quot;500&quot;, &quot;-w&quot;, &quot;1100&quot;,
                &quot;-a&quot;, &quot;PNG&quot;,
                &quot;-v It-Slav.Net&quot;,
                &quot;--slope-mode&quot;,
                &quot;DEF:price=$rrd/stock$_[0].rrd:price:AVERAGE&quot;,
                &quot;LINE2:price#FF0000:Kurs:&quot;,
#                &quot;DEF:movingavarage=$rrd/stock$_[0].rrd:movingavarage:AVERAGE&quot;,
#                &quot;LINE1:price#0000FF:Movingavarage_50days:&quot;,
                &quot;GPRINT:price:MIN:  Min\\: %6.lf&quot;,
                &quot;GPRINT:price:MAX:  Max\\: %6.lf&quot;,
                &quot;GPRINT:price:AVERAGE: Avarage\\: %6.lf&quot;,
                &quot;GPRINT:price:LAST: Last\\: %6.lf $_[0]\\n&quot;;
        if ($ERROR = RRDs::error) { print &quot;$0: unable to generate graph $_[0] $_[1] graph: $ERROR\n&quot;; }
}

sub trim($)
{
        my $string = shift;
#       $string =~ s/^\s+//; #Remove left whitespaces
#       $string =~ s/\s+$//; #Remove right whitespaces
        $string =~ s/\^//; #Remove ^
        return $string;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.it-slav.net/blogs/2008/12/11/stock-graphs/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>HowTo using passive checks with Nagios or op5 Monitor</title>
		<link>http://www.it-slav.net/blogs/2008/12/10/howto-using-passive-checks-with-nagios-or-op5-monitor/</link>
		<comments>http://www.it-slav.net/blogs/2008/12/10/howto-using-passive-checks-with-nagios-or-op5-monitor/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 18:49:30 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Cool things]]></category>
		<category><![CDATA[Hints]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[op5 Monitor]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[nsca]]></category>
		<category><![CDATA[passive]]></category>
		<category><![CDATA[passive checks]]></category>
		<category><![CDATA[send_nsca]]></category>

		<guid isPermaLink="false">http://www.it-slav.net/blogs/?p=392</guid>
		<description><![CDATA[In some cases the &#34;Normal&#34; way of running checks does not work, passive checks might do the job. I have a script the runs every night that backup my MySQL database. If this script fails I would like op5 Monitor or Nagios to send a notification. An active check will not work in this case [...]]]></description>
			<content:encoded><![CDATA[<p>In some cases the &quot;Normal&quot; way of running checks does not work, passive checks might do the job. I have a script the runs every night that backup my MySQL database. If this script fails I would like op5 Monitor or Nagios to send a notification. An active check will not work in this case or is very cumbersome to get it to work. A more elegant solution is to let the backup script send in the result to op5 Monitor or Nagios. This is where passive checks is handy. A passive check trust that some external program will send in the result. It is possible to set check_freshness so if nothing has been sent in to op5 Monitor or Nagios it will react, typically set the status to UNKOWN or CRITICAL.</p>
<p><span id="more-392"></span></p>
<p>In my case the backup script is started on another host then op5 Monitor or Nagios server, so I also will need a way of sending the data from the passive check over the network, the recommended way is to use nsca. Read the theory at <a target="_blank" href="http://nagios.sourceforge.net/docs/3_0/addons.html#nsca">http://nagios.sourceforge.net/docs/3_0/addons.html#nsca</a></p>
<p>In my op5 Monitor system the nsca daemon to recieve nsca information was installed so I only had to start it:</p>
<p>/etc/init.d/nsca start</p>
<p>This is the steps I did to install it on the client:</p>
<p>1. Download nsca from <a target="_blank" href="http://sourceforge.net/project/showfiles.php?group_id=26589&amp;package_id=40242">here</a>.</p>
<p>&nbsp;</p>
<p>2. Untar and compile nsca</p>
<p>&nbsp;</p>
<p>3. Create a ncsa config file i.e. send_nsca.cfg</p>
<pre>
encryption_method=0
</pre>
<p>Now the data will be transmitted unencrypted over the network, this might not be what you want. Make sure that the corresponding nsca config file on the Nagios or op5 Monitor host has the same encryption method.</p>
<p>4. Create a passive check for testing.</p>
<pre>
# service 'Passive check test'</pre>
<pre>
define service{</pre>
<pre>
    use                            default-service</pre>
<pre>
    host_name                      dull</pre>
<pre>
    service_description            Passive check test</pre>
<pre>
    check_command                  check_dummy!3 &quot;No Data from passive check&quot;</pre>
<pre>
    max_check_attempts             1</pre>
<pre>
    active_checks_enabled          0</pre>
<pre>
    check_freshness                1</pre>
<pre>
    freshness_threshold            300</pre>
<pre>
    flap_detection_options         n</pre>
<pre>
    contact_groups                 it-slav_mail,call_it-slav,it-slav_msn</pre>
<pre>
    stalking_options               n</pre>
<pre>
    }</pre>
<p>Explanation:</p>
<p>The check_dummy command will be run if no passive check has been recieved within 5 minutes (300 seconds).</p>
<p>4. test</p>
<p>-First test, wait 5 minutes and your service &quot;Passive check test&quot; should be in status UNKNOWN</p>
<p>-Second test, create  a file passive_file_test_critical (the separator is TAB):</p>
<pre>
dull    Passive check test      2       CRITICAL:test critical</pre>
<p>run command:</p>
<pre>
send_nsca -H nagios_host  -c  send_nsca.cfg &lt; passive_check_data_critical</pre>
<p>and the status should change to CRITICAL</p>
<p>-Third test, create a file passive_check_data_ok (the separator is TAB):</p>
<pre>
dull    Passive check test      0       OK: test ok</pre>
<p>Run the command</p>
<pre>
send_nsca -H  nagios_host -c  send_nsca.cfg &lt; passive_check_data_ok</pre>
<p>And the status should change to OK</p>
<p>&nbsp;</p>
<p>Now you can set the status of a Nagios or op5 Monitor service by using commands that can be used in scripts. I will in a later article describe how I use it in my MySQL backup script.</p>
<p>Links:</p>
<ul>
<li><a target="_blank" href="http://nagios.sourceforge.net/docs/3_0/addons.html#nsca">NSCA</a></li>
<li>Nagios <a href="http://nagios.sourceforge.net/docs/3_0/passivechecks.html">passive check</a> theory</li>
<li><a target="_blank" href="http://www.op5.com/op5/products/monitor">op5 Monitor</a></li>
<li>An <a target="_blank" href="http://www.it-slav.net/blogs/?p=319">article</a> about monitor automysqlbackup with passive checks</li>
</ul>
<p>Troubleshooting hint:</p>
<p>If it does not work, a good hint is to take a look into nagios.log</p>
]]></content:encoded>
			<wfw:commentRss>http://www.it-slav.net/blogs/2008/12/10/howto-using-passive-checks-with-nagios-or-op5-monitor/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Create Cacti or op5 Statistics graphs with op5 VmWare ESX3 plugin</title>
		<link>http://www.it-slav.net/blogs/2008/11/12/create-cacti-or-op5-statistics-graphs-with-op5-esx3-plugin/</link>
		<comments>http://www.it-slav.net/blogs/2008/11/12/create-cacti-or-op5-statistics-graphs-with-op5-esx3-plugin/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 07:54:22 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Hints]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[op5 Statistics]]></category>
		<category><![CDATA[esx]]></category>
		<category><![CDATA[esxi]]></category>
		<category><![CDATA[monitor esx]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[nagios esx]]></category>
		<category><![CDATA[nagios esxi]]></category>
		<category><![CDATA[VmWare]]></category>

		<guid isPermaLink="false">http://www.it-slav.net/blogs/?p=262</guid>
		<description><![CDATA[op5 community is growing and this scripts and definitions comes from Mikael Schmidt, IXX. I will do a step-by-step guide to get it running, if you have any questions do not hesitate to contact me peter@it-slav.net or write a comment to this blog.
This description is op5 Statistics centric, however op5 Statistics is based on Cacti [...]]]></description>
			<content:encoded><![CDATA[<p>op5 community is growing and this scripts and definitions comes from Mikael Schmidt, IXX. I will do a step-by-step guide to get it running, if you have any questions do not hesitate to contact me peter@it-slav.net or write a comment to this blog.</p>
<p>This description is op5 Statistics centric, however op5 Statistics is based on Cacti so it will work there as well. The only differences between op5 Statistics and Cacti to this guide is the paths to different files.</p>
<p>Links to the files used is located at the bottom.</p>
<p>1. Create a directory called /opt/statistics/scripts/custom</p>
<pre>
#mkdir /opt/statistics/scripts/custom</pre>
<p>Put the file esxiograph.sh in /opt/statistics/scripts/custom</p>
<p>2. Test the script by manually running the script</p>
<pre>
./esxiograph.sh io_vm vmware-stockholm demo.op5.com &lt;user&gt; &lt;password&gt;
</pre>
<pre>
usage:0.02 read:0.00 write:0.02</pre>
<p>It works</p>
<p>3. Import the xml files</p>
<p>console-&gt;import templates</p>
<p>Browse to the xml file and choose default rrd settings</p>
<p>Do it with both xml files.</p>
<p>4. Add the graph</p>
<p>console-&gt;new graph</p>
<p>Choose your vmware ESX server</p>
<p>Graph template choose &quot;ESX &#8211; IO Load per VS&quot; to graph the host vmware ESX server load</p>
<p>or &quot;ESX &#8211; IO Load per VM&quot; to graph a particular guest host.</p>
<p>Click Create</p>
<p>Enter guest name (if you pick ESX &#8211; IO Load per VM), login and password. Change the title to &quot; -IO load&quot; if it is a guest IO you are graphing otherwise all graphs will have the same name.</p>
<p><a href="http://www.it-slav.net/blogs/wp-content/uploads/2008/11/cactiv2.png"><img height="312" width="500" alt="" src="http://www.it-slav.net/blogs/wp-content/uploads/2008/11/cactiv2.png" title="cactiv2" class="alignnone size-full wp-image-270" /></a></p>
<p>Click Create</p>
<p><em>note: The login and password will be non-encrypted in a op5 Statistcs or Cacti MySQL database, use a read only user!</em></p>
<p>5. Repeat 4 with all ESX servers and guest host you want to graph.</p>
<p>Hint: to get a list of virtual machines run:</p>
<pre>
/opt/plugins/check_esx3.pl -H  -u xxxxx -p yyyyyy
 -l runtime -s list</pre>
<pre>
CHECK_ESX3.PL OK - 26/28 VMs up: xxxx.op5.se(UP), yyyyy.op5.se(UP), zzzzz.op5.com(UP)....</pre>
<p>6. Create a graph tree</p>
<p>Console-&gt;Graph Trees</p>
<p>Click add</p>
<p>Enter a name i.e. vmware ESX</p>
<p>7. Put the graphs in your graph tree with the ESX server at root</p>
<p>console-&gt;Graph Management</p>
<p>Enter ESX in search field so you only have yor hraphs containing ESX</p>
<p>click checkbox next to <span class="linkEditMain"> &#8211; VS IO Load</span></p>
<p>Choose action scrolllist &quot;Place on tree (vmware ESX)&quot;</p>
<p><a href="http://www.it-slav.net/blogs/wp-content/uploads/2008/11/cacti_punkt_7.png"><img height="312" width="500" alt="" src="http://www.it-slav.net/blogs/wp-content/uploads/2008/11/cacti_punkt_7.png" title="cacti_punkt_7" class="alignnone size-full wp-image-272" /></a></p>
<p>Click Go</p>
<p>Choose [Root]</p>
<p>8. Put the guest machines under your vmware server in the tree</p>
<p>console-&gt;Graph Trees</p>
<p>Click add</p>
<p>Enter name &quot;Guest machines&quot;</p>
<p>9. Put the guest graphs under the leaf in the graph tree</p>
<p>console -&gt; Graph Management</p>
<p>Enter ESX in search field</p>
<p>Click the checkbox next to all guests</p>
<p>Choose &quot;Place on tree (vmware ESX)&quot;</p>
<p><a href="http://www.it-slav.net/blogs/wp-content/uploads/2008/11/cacti_punkt_8.png"><img height="312" width="500" alt="" src="http://www.it-slav.net/blogs/wp-content/uploads/2008/11/cacti_punkt_8.png" title="cacti_punkt_8" class="alignnone size-full wp-image-273" /></a></p>
<p>Choose &quot;Guest Machines&quot;</p>
<p>10. Now you should have a graph tree that looks similiar to this:</p>
<p><a href="http://www.it-slav.net/blogs/wp-content/uploads/2008/11/cacti-graph-three.png"><img height="312" width="500" alt="" src="http://www.it-slav.net/blogs/wp-content/uploads/2008/11/cacti-graph-three.png" title="cacti-graph-three" class="alignnone size-full wp-image-274" /></a></p>
<p>&nbsp;</p>
<p>Congratulations, now you can look at some nice vmware I/O graphs.</p>
<p><a href="http://www.it-slav.net/blogs/wp-content/uploads/2008/11/cacti_result.png"><img height="312" width="500" alt="" src="http://www.it-slav.net/blogs/wp-content/uploads/2008/11/cacti_result.png" title="cacti_result" class="alignnone size-full wp-image-291" /></a></p>
<p>&nbsp;</p>
<p>Links:</p>
<ul>
<li><a target="_blank" href="http://www.op5.com/op5/products/statistics">op5 Statistics</a></li>
<li><a target="_blank" href="http://www.cacti.net/">Cacti</a></li>
<li><a target="_blank" href="http://www.it-slav.net/~peter/blog/esx_graphs.zip">Files used in this guide</a></li>
<li><a target="_blank" href="http://www.ixx.se/">IXX IT-Partner AB<br />
    </a></li>
<li>op5 <a target="_blank" href="http://www.it-slav.net/~peter/blog/check_esx3.pl">check_esx3.pl</a></li>
</ul>
<p>&nbsp;</p>
<p><span id="more-262"></span></p>
<p><!--more--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.it-slav.net/blogs/2008/11/12/create-cacti-or-op5-statistics-graphs-with-op5-esx3-plugin/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>op5 Monitor reports</title>
		<link>http://www.it-slav.net/blogs/2008/11/10/op5-monitor-reports/</link>
		<comments>http://www.it-slav.net/blogs/2008/11/10/op5-monitor-reports/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 09:14:09 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Hints]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[op5 Monitor]]></category>
		<category><![CDATA[Availability]]></category>
		<category><![CDATA[Reports]]></category>
		<category><![CDATA[SLA]]></category>

		<guid isPermaLink="false">http://www.it-slav.net/blogs/?p=229</guid>
		<description><![CDATA[If you think Nagios got everything you need except nice reports. op5 Monitor has the solution to this issue. op5 have customers that are using op5 Monitor just for the reporting part and using other tools for monitoring.
op5 has put alot of resources into reporting because that is the feedback we got from our customers. [...]]]></description>
			<content:encoded><![CDATA[<p>If you think <a href="http://www.nagios.org" target="_blank">Nagios</a> got everything you need except nice reports. <a href="http://www.op5.com/op5/products/monitor" target="_blank">op5 Monitor</a> has the solution to this issue. <a href="http://www.op5.com" target="_blank">op5</a> have customers that are using <a href="http://www.op5.com/op5/products/monitor" target="_blank">op5 Monitor</a> just for the reporting part and using other tools for monitoring.</p>
<p><a href="http://www.op5.com" target="_blank">op5</a> has put alot of resources into reporting because that is the feedback we got from our customers. Here is two examples of reports:</p>
<ul>
<li>Availability <a href="http://www.it-slav.net/~peter/blog/avial-sjobergs.pdf" target="_blank">report</a></li>
<li>SLA <a href="http://www.it-slav.net/~peter/blog/SLA_rapport_rsync_sjobergs.pdf" target="_blank">report</a></li>
</ul>
<p>The reports is based on monitoring a friends home file server in Gothenburg, thats why it is not five nines <img src='http://www.it-slav.net/blogs/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.it-slav.net/blogs/2008/11/10/op5-monitor-reports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Temperature Graphs</title>
		<link>http://www.it-slav.net/blogs/2008/11/05/temperature-graphs/</link>
		<comments>http://www.it-slav.net/blogs/2008/11/05/temperature-graphs/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 05:51:57 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[1-wire]]></category>
		<category><![CDATA[Cool things]]></category>
		<category><![CDATA[Geek stuff]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[Add new tag]]></category>

		<guid isPermaLink="false">http://www.it-slav.net/blogs/?p=75</guid>
		<description><![CDATA[After succefully get your 1-wire bus working with OWFS and been able to read the temperatures, it is time to create some nice graphs. The red line is the temperature and the blue is the sliding avarage temperature the last 24 hours. I&#8217;m using RRDTools to store the data and create the graphs. If you [...]]]></description>
			<content:encoded><![CDATA[<p>After <a href="http://www.it-slav.net/blogs/?p=67" target="_blank">succefully</a> get your 1-wire bus working with <a href="http://www.owfs.org/" target="_blank">OWFS</a> and been able to read the temperatures, it is time to create some nice <a href="http://www.it-slav.net/~peter/temps/" target="_blank">graphs.</a> The red line is the temperature and the blue is the sliding avarage temperature the last 24 hours. I&#8217;m using <a href="http://oss.oetiker.ch/rrdtool/" target="_blank">RRDTools</a> to store the data and create the graphs. If you want to use RRDTools and RRDGraph for your own purposes I recommend you to read the manual pages several times and start easy and build more and more complex solutions.</p>
<p>Here is the script that I&#8217;m using to read the temperatures, store the data in a round robin database and finally create the graphs.</p>
<pre>#!/usr/bin/perl</pre>
<pre># By Peter Andersson peter@it-slav.net</pre>
<pre># rrd_tempsensor.pl</pre>
<pre>use RRDs;</pre>
<pre>use OW;</pre>
<pre># define location of rrdtool databases</pre>
<pre>my $rrd = '/root/owfs/script/rrd_db';</pre>
<pre># define location of images</pre>
<pre>my $img = '/home/peter/public_html/temps';</pre>
<pre># process data for each interface (add/delete as required)</pre>
<pre>&amp;ProcessSensor(0, "Temperatur i garaget", "127.0.0.1" , "3001" , "10.87507C010800");</pre>
<pre>&amp;ProcessSensor(1, "Temperatur i PDCn", "op5.mynet",3001, "10.04E060010800");</pre>
<pre>&amp;ProcessSensor(2, "Temperatur ute", "op5.mynet",3001,"10.DEF05F010800");</pre>
<pre>sub ProcessSensor</pre>
<pre>{</pre>
<pre># process sensor</pre>
<pre># inputs: $_[0]: sensor number (ie, 0/1/2/etc)</pre>
<pre>#         $_[1]: sensor description</pre>
<pre>        print "number:$_[0] desc:$_[1], server:$_[2] port:$_[3], id: $_[4]\n";</pre>
<pre>        my $owserver = "$_[2]:$_[3]";</pre>
<pre>        unless(OW::init($owserver)) {</pre>
<pre>            $status = $ERRORS{CRIT};</pre>
<pre>            $message = "OWServer not running at $owserver\n";</pre>
<pre>            exit $status;</pre>
<pre>        }</pre>
<pre>        # get temperature from sensor</pre>
<pre>        my $handle = OW::get("$_[4]/temperature");</pre>
<pre>#       print "handle=$handle\n";</pre>
<pre>        $handle =~ s/^\s*(.*?)\s*$/$1/;</pre>
<pre>        ## Check if input is an integer or decimal</pre>
<pre>        unless (($handle =~ /^-?(?:\d+(?:\.\d*)?|\.\d+)$/) || ($handle =~ /^[+-]?\d+$/))</pre>
<pre>        {</pre>
<pre>                print "Not an integer or a decimal\n";</pre>
<pre>                return($ERRORS{CRITICAL});</pre>
<pre>        }</pre>
<pre>        $temp=$handle;</pre>
<pre>        # remove eol chars</pre>
<pre>        chomp($temp);</pre>
<pre>        print "sensor $_[0]: $temp degrees C\n";</pre>
<pre>        # if rrdtool database doesn't exist, create it</pre>
<pre>        if (! -e "$rrd/temp$_[0].rrd")</pre>
<pre>        {</pre>
<pre>                print "creating rrd database for temp sensor $_[0]...\n";</pre>
<pre>                RRDs::create "$rrd/temp$_[0].rrd",</pre>
<pre>                        "-s 300",</pre>
<pre>                        "DS:temp:GAUGE:600:U:U",</pre>
<pre>                        "RRA:AVERAGE:0.5:1:2016",</pre>
<pre>                        "RRA:AVERAGE:0.5:6:1344",</pre>
<pre>                        "RRA:AVERAGE:0.5:24:2190",</pre>
<pre>                        "RRA:AVERAGE:0.5:144:3650";</pre>
<pre>        }</pre>
<pre>        if ($ERROR = RRDs::error) { print "$0: failed to create $_[0] database file: $ERROR\n"; }</pre>
<pre>        # check for error code from temp sensor</pre>
<pre>        if (int $temp eq 85)</pre>
<pre>        {</pre>
<pre>                print "failed to read value from sensor $_[0]\n";</pre>
<pre>        }</pre>
<pre>        else</pre>
<pre>        {</pre>
<pre>                # insert values into rrd</pre>
<pre>                RRDs::update "$rrd/temp$_[0].rrd",</pre>
<pre>                        "-t", "temp",</pre>
<pre>                        "N:$temp";</pre>
<pre>                if ($ERROR = RRDs::error) { print "$0: failed to insert $_[0] data into rrd: $ERROR\n"; }</pre>
<pre>        }</pre>
<pre>        # create graphs for current sensor</pre>
<pre>        &amp;CreateGraph($_[0], "day", $_[1]);</pre>
<pre>        &amp;CreateGraph($_[0], "week", $_[1]);</pre>
<pre>        &amp;CreateGraph($_[0], "month", $_[1]);</pre>
<pre>        &amp;CreateGraph($_[0], "year", $_[1]);</pre>
<pre>}</pre>
<pre>sub CreateGraph</pre>
<pre>{</pre>
<pre># creates graph</pre>
<pre># inputs: $_[0]: sensor number (ie, 0/1/2/etc)</pre>
<pre>#         $_[1]: interval (ie, day, week, month, year)</pre>
<pre>#         $_[2]: sensor description</pre>
<pre>        RRDs::graph "$img/temp$_[0]-$_[1].png",</pre>
<pre>                "-s -1$_[1]",</pre>
<pre>                "-t $_[2]",</pre>
<pre>                "-h", "150", "-w", "475",</pre>
<pre>                "-a", "PNG",</pre>
<pre>                "-v WWW.It-Slav.Net",</pre>
<pre>                "--slope-mode",</pre>
<pre>                "DEF:temp=$rrd/temp$_[0].rrd:temp:AVERAGE",</pre>
<pre>                "LINE2:temp#FF0000::",</pre>
<pre>                "CDEF:tempavarage=temp,86400,TREND",</pre>
<pre>                "LINE1:tempavarage#000088::",</pre>
<pre>                "GPRINT:temp:MIN:  Min\\: %6.1lf",</pre>
<pre>                "GPRINT:temp:MAX:  Max\\: %6.1lf",</pre>
<pre>                "GPRINT:temp:AVERAGE: Snitt\\: %6.1lf",</pre>
<pre>                "GPRINT:temp:LAST: Nuvarande\\: %6.1lf grader C\\n";</pre>
<pre>        if ($ERROR = RRDs::error) { print "$0: unable to generate sensor $_[0] $_[1] graph: $ERROR\n"; }</pre>
<pre>}</pre>
<p>Use crontab to run it every 5 minutes:</p>
<pre>*/5     *       *       *       *       /root/owfs/script/tempgraph.pl &gt; /dev/null</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.it-slav.net/blogs/2008/11/05/temperature-graphs/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Spamfighting</title>
		<link>http://www.it-slav.net/blogs/2008/11/02/spamfighting/</link>
		<comments>http://www.it-slav.net/blogs/2008/11/02/spamfighting/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 09:38:50 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Geek stuff]]></category>
		<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://www.it-slav.net/blogs/?p=70</guid>
		<description><![CDATA[I do not like spam.
This a problem that grows and there are many technologies how to fight it.
As I&#8217;m the sysadmin of my mailserver it makes it possible to use many approaches. The best way is to find out if it is a spam before it is accepted at the SMTP server. I&#8217;m using a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>I do not like spam.</strong></p>
<p>This a problem that grows and there are many technologies how to fight it.</p>
<p>As I&#8217;m the sysadmin of my mailserver it makes it possible to use many approaches. The best way is to find out if it is a spam before it is accepted at the SMTP server. I&#8217;m using a<a href="http://flakshack.com/anti-spam/wiki/index.php?page=FairlySecureAntiSpamWiki" target="_blank"> Fairly-Secure Anti-SPAM Gateway Using OpenBSD, Postfix, Greylisting, Amavisd-new, SpamAssassin, Razor and DCC</a> and it is very effective.</p>
<ul>
<li>The first filter is to check if the receiver of the mail is valid. It might seem like a obvious first filter but in many cases the host that receives mails from internet only forward the mail to an inner mail server and suddenly invalid mails with probably incorrect <strong>from</strong> address is the receiving organizations problem. With this approach a valid mail but misspelled <strong>to</strong> address will bounce back to the sender. If it is a spam mail it will be the sending hosts problem how to handle. I graph this and it can be found <a title="Graph Rejected mails it-slav.net" href="http://www.it-slav.net/~spamreport/mailrejected-year.png" target="_blank">here</a>. A qualified guess is that more or less all of them are spams.</li>
<li>The second step is a little bit more complex, the mail is scanned before it is accepted. So if my spam scanner finds that the mail is a spam it will tell the sending mailserver that it-slav.net thinks that this mail is a spam and that it is not accepted. If nothing suspicious is found the mailserver accept the mail  and it will be sent to my mailserver. The number of mails that are scanned and a spam is found is graphed and it can be found <a title="Graph spam mails It-Slav.Net" href="http://www.it-slav.net/~spamreport/mailspam-year.png" target="_blank">here</a>.</li>
<li>A third technology I have used is <a href="http://en.wikipedia.org/wiki/Greylisting" target="_blank">greylistening</a>, it is very effective but the technologies described above is good enough for me so I&#8217;m not using it now. It puts a little more burden on the sending host and the first time a host sends a mail to a new host it will take some extra time.</li>
<li>A promising technlogy is <a title="SPF homepage" href="http://www.openspf.org/" target="_blank">SPF</a>, the idea is to guarantee that the sending mail comes from the place were it claims to come from, a good <a href="http://en.wikipedia.org/wiki/Sender_Policy_Framework" target="_blank">description</a> can be found at <a href="http://www.wikipedia.org/" target="_blank">wikipedia</a>. Spamassassin use SPF. If you want to avoid that your domain can be used as the sender of a spam, add some extra lines to your DNS record.</li>
<li>To annoy spamsenders a good idea could be to start a <a title="tarpit" href="http://en.wikipedia.org/wiki/Tarpit_(networking)" target="_blank">tarpit</a>. Send all spammsenders to your tarpitt and enjoy when they use their resources for nothing. It is i<a title="spamd" href="http://www.openbsd.org/cgi-bin/man.cgi?query=spamd&amp;apropos=0&amp;sektion=0&amp;manpath=OpenBSD+Current&amp;arch=i386&amp;format=html" target="_blank">ncluded</a> in <a href="http://www.openbsd.org">OpenBSD</a> in compination with greylistening.</li>
</ul>
<p>Graphs</p>
<ul>
<li><a href="http://www.it-slav.net/~spamreport/mailrejected-year.png" target="_blank">Rejected</a><a href="http://www.it-slav.net/~spamreport/mailrejected-year.png" target="_blank"><br />
</a></li>
<li><a href="http://www.it-slav.net/~spamreport/mailspam-year.png" target="_blank">Spam</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.it-slav.net/blogs/2008/11/02/spamfighting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
