CGI script to see collectd stats

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

CGI script to see collectd stats

Ajitabh Pandey
Hello,

I am running collectd server on my OpenBSD 6.1 box and various clients are
sending stats to this box. I see /var/collectd that various RRDs are
getting created. However, I am not sure what should I used to see the
graphs. I looked at RRDCGI but it looks way complicated to setup. I could
not find collectd-web package also.

Searching on web I see that for a non-chrooted web server there are
straight forward scripts available. Most of the instructions are for linux.

I would prefer to use OpenBSD httpd and not resort to non-chrooted apache
or nginx. I am finding it really difficult to find something suitable which
works under chroot.

I am able to run a hello world cgi script in chroot.

If any of you guys have some information/config/tool etc to share for
collectd graphs, it would be of great help.

Thanks & Regards.
--
Ajitabh Pandey
http://ajitabhpandey.info/
Reply | Threaded
Open this post in threaded view
|

Re: CGI script to see collectd stats

Alceu Rodrigues de Freitas Junior
Em 10/05/2017 07:54, Ajitabh Pandey escreveu:

> Hello,
>
> I am running collectd server on my OpenBSD 6.1 box and various clients are
> sending stats to this box. I see /var/collectd that various RRDs are
> getting created. However, I am not sure what should I used to see the
> graphs. I looked at RRDCGI but it looks way complicated to setup. I could
> not find collectd-web package also.
>
> Searching on web I see that for a non-chrooted web server there are
> straight forward scripts available. Most of the instructions are for linux.
>
> I would prefer to use OpenBSD httpd and not resort to non-chrooted apache
> or nginx. I am finding it really difficult to find something suitable which
> works under chroot.
>
> I am able to run a hello world cgi script in chroot.
>
> If any of you guys have some information/config/tool etc to share for
> collectd graphs, it would be of great help.
>
> Thanks & Regards.
>

Can't help with your chroot requisite. But I did spent some doing
looking into that and can share something.

All (Perl) CGI's is something I don't recommend to. First, they are
CGIs, second, even if you're able to configure them you will get a lot
of warnings because the CGI module in Perl is getting deprecated.

I went with rrdscout (Flask web application). It should be enough for
your needs and uses a modern framework. On the other hand, I'm not sure
it is being maintained anymore. I forked it on Github and generate a
INSTALL document specific for OpenBSD:

https://github.com/glasswalk3r/rrdscout/blob/master/INSTALL-openbsd.txt

I had to install freetype from ports too to be able to generated
readable charts from the RRD:

cd /usr/ports/print/freetype
make install
make clean
make clean=depends

Hope that helps you.

Regards,
Alceu

Reply | Threaded
Open this post in threaded view
|

Re: CGI script to see collectd stats

Predrag Punosevac-2
In reply to this post by Ajitabh Pandey
Ajitabh Pandey wrote:

> Hello,
>
> I am running Collectd server on my OpenBSD 6.1 box and various clients
> are
> sending stats to this box. I see /var/collectd that various RRDs are
> getting created. However, I am not sure what should I used to see the
> graphs. I looked at RRDCGI but it looks way complicated to setup. I
> could
> not find collectd-web package also.
>
Hi,

I have being using Collectd for remote telemetry in my Lab for over 4
years and I have being running Collectd server on OpenBSD for the past
two.

The lack of decent working front-end is the Achilles tendon of Collectd
which IMHO is eventually going to kill the project now when it is
becoming clear that Whisper has some advantages over RRD. Before I go
any further let me know what I do and what works really well.


The best front end for Collectd is in fact Observium and its fork
LibreNMS which is in OpenBSD ports.

http://www.observium.org/

Observium is main polling protocol is SNMP. Setting Observium/LibreNMS
is not trivial but it is not too difficult either. You can find my and
Stuart's discusion on misc how to set LibreNMS which runs fairly well on
OpenBSD. His pkg-readme is must! Before the LibreNMS fork which occurred
2 years ago I was using

https://www.turnkeylinux.org/observium

since Observium project explicitly doesn't support anything except
Ubuntu and Debian. Once you have Observium or LibreNMS polling your
devices displaying collectd graphs is just adding a line in the
Observium/Collectd config file which will point the application to the
location of RRD files gathered by collectd server. The only caveat is
that you have to poll the device to be able to see collectd button which
will take you to magnificent graphs. This did hurt me personally as I
don't SNMP poll KVM guests on one of my KVM hosts but I do have RRD data
for the guests via collectd KVM plugin. The another really big problem
with Observium/LibreNMS is the lack of a proxy which is needed for
monitoring devices behind firewalls. You don't have that problem with
collectd which works on the push principle. It is a bit of problem for
me as I do have a private subnet behind somebody's else firewall.


Recently, a front-end for Collectd, called facette has being added to
ports

http://openports.se/sysutils/facette

It is dead simple to set up but useless as each graph has to be created
manually from data. With my RRD folder containing close to 1500 files
that is just ridicules. Observium/LibreNMS automatically create graphs
for all available RRDs minus the KVM guest caveat.

The only other front-end for Collectd which actually works (at least for
me) is Collectd-web

https://collectd.org/wiki/index.php/File:Collectd-web.png

It does create graphs automatically for all available devices but the
quality of both interface and graphs is inferior comparing to
Observium/LibreNMS.



I will finish this long post by bringing to your attention that Collectd
can send time-series directly to carbon-aggregator which in turns writes
it to Wisper.

https://collectd.org/wiki/index.php/Plugin:Write_Graphite


That will enable you to see your time-series using Graphite-web (IIRC
doesn't run on OpenBSD). We have played in my Lab (machine
learning/statistical data-mining) with Graphite-web due to our internal
needs for a good tool for time-series display. I can tell you that
Graphite is second to none in what it does and we are using it for our
research (but not for infrastructure monitoring).

Best,
Predrag

P.S. I am looking forward to see what other people have to say about
this topic.




> Searching on web I see that for a non-chrooted web server there are
> straight forward scripts available. Most of the instructions are for
> linux.
>
> I would prefer to use OpenBSD httpd and not resort to non-chrooted
> apache
> or nginx. I am finding it really difficult to find something suitable
> which
> works under chroot.
>
> I am able to run a hello world cgi script in chroot.
>
> If any of you guys have some information/config/tool etc to share for
> collectd graphs, it would be of great help.
>
> Thanks & Regards.
> --
> Ajitabh Pandey

Reply | Threaded
Open this post in threaded view
|

Re: CGI script to see collectd stats

Olivier Cherrier
In reply to this post by Ajitabh Pandey
On Wed, May 10, 2017 at 04:24:44PM +0530, [hidden email] wrote:

> Hello,
>
> I am running collectd server on my OpenBSD 6.1 box and various clients are
> sending stats to this box. I see /var/collectd that various RRDs are
> getting created. However, I am not sure what should I used to see the
> graphs. I looked at RRDCGI but it looks way complicated to setup. I could
> not find collectd-web package also.
>
> Searching on web I see that for a non-chrooted web server there are
> straight forward scripts available. Most of the instructions are for linux.
>
> I would prefer to use OpenBSD httpd and not resort to non-chrooted apache
> or nginx. I am finding it really difficult to find something suitable which
> works under chroot.
>
> I am able to run a hello world cgi script in chroot.
>
> If any of you guys have some information/config/tool etc to share for
> collectd graphs, it would be of great help.
>
> Thanks & Regards.
> --
> Ajitabh Pandey
> http://ajitabhpandey.info/


        Hi,

I'm using http://web.taranis.org/drraw/ for years.
It is very simple but quite powerfull with its regexp feature.


--
Olivier Cherrier
mailto:[hidden email]