<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=DE link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hello,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>at first please excuse my bad english.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>I have create an perl script to receive four values.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Now I want to create four single rrd files, but I don&#8217;t
now how.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>When I start collectd with the option &#8211;T I get
this message<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>LOG: 4 - perl: Collectd::plugin_dispatch_values with
two arguments is deprecated - pass the type through values-&gt;{type}.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>At this time I get only one rrd-file with the four
values.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>What is the right way to get four single rrd-files?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Can someone help me?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Thanks,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Frank<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>This is my config in collectd.conf:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>&lt;Plugin perl&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IncludeDir
&quot;/home/frank&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BaseName
&quot;Collectd::Plugins&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LoadPlugin
&quot;Energymeter&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>&lt;/Plugin&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>And this is my perl.script:<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>#!/usr/bin/perl -w<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>use IO::Socket;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>use strict;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>use warnings;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>package
Collectd::Plugins::Energymeter;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>use Collectd qw( :all );<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>my $dataset =<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;[<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp; {<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;
name =&gt; 'energy1_ds',<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;
type =&gt; Collectd::DS_TYPE_GAUGE,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;
min&nbsp; =&gt; 0,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;
max&nbsp; =&gt; 65536.0,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp; },<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp; {<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;
name =&gt; 'energy2_ds',<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;
type =&gt; Collectd::DS_TYPE_GAUGE,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;
min&nbsp; =&gt; 0,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;
max&nbsp; =&gt; 65536.0,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp; },<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp; {<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;
name =&gt; 'energy3_ds',<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;
type =&gt; Collectd::DS_TYPE_GAUGE,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;
min&nbsp; =&gt; 0,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;
max&nbsp; =&gt; 65536.0,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp; },<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp; {<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;
name =&gt; 'energy4_ds',<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;
type =&gt; Collectd::DS_TYPE_GAUGE,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;
min&nbsp; =&gt; 0,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;
max&nbsp; =&gt; 65536.0,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp; }<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;];<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'># This code is executed
after loading the plugin to register it with collectd.<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Collectd::plugin_register
(Collectd::TYPE_LOG, 'Energymeter', 'my_log' );<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Collectd::plugin_register
(Collectd::TYPE_DATASET, 'Energymeter', $dataset);<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Collectd::plugin_register
(Collectd::TYPE_INIT, 'Energymeter', 'my_init' );<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Collectd::plugin_register
(Collectd::TYPE_READ, 'Energymeter', 'my_read' );<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Collectd::plugin_register
(Collectd::TYPE_WRITE, 'Energymeter', 'my_write' );<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Collectd::plugin_register
(Collectd::TYPE_SHUTDOWN, 'Energymeter', 'my_shutdown' );<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'># This function is called
once upon startup to initialize the plugin.<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>sub my_init<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>{<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# open sockets, initialize data structures, ...<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# A false return value indicates an error and causes the plugin to be<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# disabled.<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return 1;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>} # my_init ()<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;# This function is
called in regular intervals to collectd the data.<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>sub my_read<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>{<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; my $vl
= {};<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; my
$socket = '';<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; my
$ip_address&nbsp; = &quot;192.168.210.10&quot;;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; my
$power1 = 0;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; my
$power2 = 0;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; my
$power3 = 0;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; my
$power4 = 0;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp; <o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;
$socket = new IO::Socket::INET (<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
PeerAddr =&gt; $ip_address,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
PeerPort =&gt; 3673,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Type =&gt; 1,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Proto&nbsp;&nbsp;&nbsp; =&gt; getprotobyname('tcp'),<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; );<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; die
&quot;Energymeter: Unable to open connection: $!\n&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
unless defined $socket;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;
$socket-&gt;autoflush(1);<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; print
$socket &quot;get_value&quot;;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; #while
(&lt;$socket&gt;)();<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; my
$data = &lt;$socket&gt;;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; my
@tokens = split(/ /,$data);<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; my
@local_temp = split(/:/,$tokens[0]);<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;
$power1 = $local_temp[1];<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;
@local_temp = split(/:/,$tokens[1]);<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;
$power2 = $local_temp[1];<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;
@local_temp = split(/:/,$tokens[2]);<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; $power3
= $local_temp[1];<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;
@local_temp = split(/:/,$tokens[3]);<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;
chop($local_temp[1]);<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; <o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;
$power4 = $local_temp[1];<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;
$vl-&gt;{'values'} = [ $power1, $power2, $power3, $power4 ];<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;
$vl-&gt;{'plugin'} = 'Energymeter';<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;
Collectd::plugin_dispatch_values ( 'Energymeter', $vl );<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; close
$socket;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; return
1;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>}<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'># This function is called
after values have been dispatched to collectd.<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>sub my_write<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>{<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
my $type = shift;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
my $ds&nbsp;&nbsp; = shift;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
my $vl&nbsp;&nbsp; = shift;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (scalar (@$ds) != scalar (@{$vl-&gt;{'values'}})) {<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Collectd::plugin_log (Collectd::LOG_WARNING,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot;DS number does not match values length&quot;);<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
for (my $i = 0; $i &lt; scalar (@$ds); ++$i) {<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# do the magic to output the data<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
print &quot;$vl-&gt;{'host'}: $vl-&gt;{'plugin'}: &quot;;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (defined $vl-&gt;{'plugin_instance'}) {<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
print &quot;$vl-&gt;{'plugin_instance'}: &quot;;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;}<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
print &quot;$type: &quot;;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (defined $vl-&gt;{'type_instance'}) {<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
print &quot;$vl-&gt;{'type_instance'}: &quot;;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
print &quot;$vl-&gt;{'values'}-&gt;[$i]\n&quot;;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return 1;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>} # my_write()<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'># This function is called
before shutting down collectd.<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>sub my_shutdown<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>{<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# close sockets, ...<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return 1;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>} # my_shutdown ()<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'># This function is called
when plugin_log () has been used.<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>sub my_log<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>{<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
my $level = shift;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
my $msg&nbsp;&nbsp; = shift;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
print &quot;LOG: $level - $msg\n&quot;;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return 1;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>} # my_log ()<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>return 1;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>