<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Hello,</span></div><div><span></span>&nbsp;</div><div><span>Hm, would&nbsp;exec plugin work?&nbsp;I was under the impression that:</span></div><div><span><br>* Collectd has to run as root</span></div><div><span>* Exec plugin has to run as non-root user: "If the daemon runs as root, you <em>have to</em> configure another user ID with which the new process is created." from <a href="http://collectd.org/wiki/index.php/Plugin:Exec">http://collectd.org/wiki/index.php/Plugin:Exec</a></span></div><div><span></span>&nbsp;</div><div><span>Because of the above, the script running as exec plugin wouldn't have the privileges to remove root-owned files collectd created.</span></div><div><span></span>&nbsp;</div><div><span>So our original questions are:<br><br>1) Is either Perl or Python plugin support available in all collectd
 packages or at least collectd packages the most popular Linux distros use?<br> <br>2) Should we use Perl or Python for this - are they equal in terms of capabilities, limitations, and being updated with every collectd release?<br></span></div><div><span>Many thanks,</div></span><div><span>Otis</span></div><div><span></span>&nbsp;</div><div><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font size="2" face="Arial"><div style="margin: 5px 0px; padding: 0px; border: 1px solid rgb(204, 204, 204); line-height: 0; font-size: 0px;" class="hr" contentEditable="false" readonly="true"></div><b><span style="font-weight: bold;">From:</span></b> Mariusz Gronczewski &lt;xani666@gmail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> O G &lt;otis_junk@yahoo.com&gt;<br><b><span style="font-weight: bold;">Cc:</span></b>
 ""collectd@verplant.org"" &lt;collectd@verplant.org&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Friday, June 17, 2011 12:31 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [collectd] Need advice: Perl or Pyhon for writing plugins?<br></font><wbr>
<meta content="off" http-equiv="x-dns-prefetch-control"><div id="yiv16590221">Well simplest would be just running (any) program using "exec" plugin... collectd will just restart it when it dies<wbr>But then logrotate is pretty much standard for any linux boxes and it's included in repo of most UNIX-es, why reinvent the wheel ? Or use cron ('add one line here' is not too hard even for pretty dumb clients ;))<wbr>
<wbr><div class="yiv16590221gmail_quote">2011/6/16 O G <span dir="ltr">&lt;<a href="mailto:otis_junk@yahoo.com" rel="nofollow" target="_blank" ymailto="mailto:otis_junk@yahoo.com">otis_junk@yahoo.com</a>&gt;</span><wbr><blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="yiv16590221gmail_quote">
<div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 12pt; background-color: rgb(255, 255, 255);"><div><span>Hello,</span></div><div><span></span>&nbsp;</div><div><span>By "collectd-generated files/logs" I really mean files with metric info that collectd generates, like this for example:</span></div>
<div><span></span>&nbsp;</div><div>$ ls -al cpu-0/cpu-idle-2011-06-*<wbr>-rw-r--r-- 1 root root 180986 2011-06-14 23:59 cpu-0/cpu-idle-2011-06-14<wbr>-rw-r--r-- 1 root root 180987 2011-06-15 23:59 cpu-0/cpu-idle-2011-06-15<wbr>-rw-r--r-- 1 root root 129827 2011-06-16 17:14 cpu-0/cpu-idle-2011-06-16</div>
<div>&nbsp;</div><div>The thinking behind writing a collectd plugin that removes old&nbsp;files like those above is precisely to eliminate the need for external tool (which needs to be installed and/or configured).&nbsp; We have a performance monitoring service (see http://sematext.com/spm/index.html&nbsp;) that requires users to install collectd on their servers (because we get info about CPU, disk, etc. from collectd).&nbsp; We want to minimize what they need to install or configure on their own, so instead of telling them "Hey, you need to install logrotate and use our logrotate config file and make sure this is run from cron every night...", we would like to have a "collectd plugin for collectd old file removal" that ships with our software and that collectd would just automatically run, thus making our users' lives simpler.</div>
<div>&nbsp;</div><div>Is there a better or simpler way to achieve this?</div><div>Maybe I need to start a separate thread on this subject...</div><div>&nbsp;</div><div>Thanks,</div><div>Otis</div><div><br>&nbsp;</div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;">
<div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font size="2" face="Arial"><div style="margin: 5px 0px; padding: 0px; border: 1px solid rgb(204, 204, 204); line-height: 0; font-size: 0px;">
</div><b><span style="font-weight: bold;">From:</span></b> XANi &lt;<a href="mailto:xani666@gmail.com" rel="nofollow" target="_blank" ymailto="mailto:xani666@gmail.com">xani666@gmail.com</a>&gt;<br><b><span style="font-weight: bold;">To:</span></b> O G &lt;<a href="mailto:otis_junk@yahoo.com" rel="nofollow" target="_blank" ymailto="mailto:otis_junk@yahoo.com">otis_junk@yahoo.com</a>&gt;<br>
<b><span style="font-weight: bold;">Cc:</span></b> "<a href="mailto:collectd@verplant.org" rel="nofollow" target="_blank" ymailto="mailto:collectd@verplant.org">collectd@verplant.org</a>" &lt;<a href="mailto:collectd@verplant.org" rel="nofollow" target="_blank" ymailto="mailto:collectd@verplant.org">collectd@verplant.org</a>&gt;<br>
<b><span style="font-weight: bold;">Sent:</span></b> Wednesday, June 15, 2011 5:54 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [collectd] Need advice: Perl or Pyhon for writing plugins?<br></font><u></u><div>



  
  

 
Dnia 2011-06-14, wto o godzinie 10:39 -0700, O G pisze:
<blockquote type="CITE">
<pre>Hello,
&nbsp;
My team and I are&nbsp;interested in writing a plugin that cleans old collectd-generated files/logs (so we don't have to rely on an external config/tool like logrotate to clean up after collectd).&nbsp; We've written such a plugin in Java, but discovered that Java plugin support is not included in all/many collectd packages out there, so we can't count on this working for all Linux distros, for example.
&nbsp;
Thus, we are&nbsp;now considering writing this plugin in either Perl or Python.
&nbsp;
So our questions are:
&nbsp;
1) Is either Perl or Python plugin support available in all collectd packages or at least collectd packages the most popular Linux distros use?
&nbsp;
2)&nbsp;Should we use Perl or Python for this - are they equal in terms of capabilities, limitations, and being updated with every collectd release?
&nbsp;
Any help would be *greatly* appreciated.
&nbsp;
Thanks,
Otis
</pre>
</blockquote>
What exactly do you mean by "collectd-generated files/logs" ? daemon logs, .rrd files, both or something else.<u></u>
And why it have to be collectd plugin, you can make standalone program and just communicate via unixsock with collectd.<u></u>
<u></u>
<table cellSpacing="0" cellPadding="0" width="100%">
<tbody><tr>
<td>
<pre>-- 
Mariusz Gronczewski (XANi) &lt;<a href="mailto:xani666@gmail.com" rel="nofollow" target="_blank" ymailto="mailto:xani666@gmail.com">xani666@gmail.com</a>&gt;
GnuPG: 0xEA8ACE64
http://devrandom.pl
</pre>
</td>
</tr>
</tbody></table>
 

</div><u></u><u></u></div></div></div></div><br>_______________________________________________<br>
collectd mailing list<br>
<a href="mailto:collectd@verplant.org" rel="nofollow" target="_blank" ymailto="mailto:collectd@verplant.org">collectd@verplant.org</a><br>
http://mailman.verplant.org/listinfo/collectd<br>
<br></blockquote></div><wbr>
</div><meta content="on" http-equiv="x-dns-prefetch-control"><wbr><wbr></div></div></div></body></html>