Sebastian Harl | 4 Dec 2005 18:40
Gravatar

users plugin

Hi there,

I've written a small plugin for collectd which counts the number of users
logged into the system. It is based on revision 258 of the source code. I
could only test it on my Linux box, but it should work on any other Unix
System as well - any feedback is appreciated ;-)

Also, I found that the '-P' command line option was still undocumented in the
manpage, so I added an appropriate section to the POD-file.

Hope you'll like it ;-)

Cheers,
Sebastian

Index: contrib/users
===================================================================
--- contrib/users	(revision 0)
+++ contrib/users	(revision 0)
 <at>  <at>  -0,0 +1,34  <at>  <at> 
+#!/bin/sh
+
+FILE="/var/lib/collectd/users.rrd"
+HOST=""
+
+if [ -n "$SERVER_NAME" ]; then
+    HOST=$SERVER_NAME
+    echo "Content-Type: image/png";
+    echo "";
+else
(Continue reading)

Sebastian Harl | 4 Dec 2005 19:28
Gravatar

Re: users plugin

> I
> could only test it on my Linux box, but it should work on any other Unix
> System as well - any feedback is appreciated ;-)

Well, I should have read all of getutent(3). Close to the end it says:

  All  these  functions  are  obsolete  now  on non-Linux systems.  POSIX
  1003.1-2001, following XPG4.2, does not have any  of  these  functions,
  but instead uses

  #include <utmpx.h>

I fixed this issue and commited the new version to the SVN repository.

Thanks to Florian for the hint.

Cheers,
--

-- 
Sebastian "tokkee" Harl
GnuPG-ID: 0x8501C7FC
http://tokkee.org/

Muralito | 5 Dec 2005 05:13
Picon
Favicon

plans on adding filesystem total & free blocks monitoring?

Hi.

Thanks for this software. I have been using it for a couple of months 
and works great.

There are any plans to add filesystem info, like total & free blocks?

In version 3.1 (do I need to update?), the hddtemp rrds are named 
hddtemp-sdb.rrd and hddtemp-8-0.rrd. Why this difference?

Regards,
Muralito.

Florian Forster | 5 Dec 2005 08:59
Favicon

Re: plans on adding filesystem total & free blocks monitoring?

Good morning,

On Mon, Dec 05, 2005 at 02:13:35AM -0200, Muralito wrote:
> There are any plans to add filesystem info, like total & free blocks?

kind of.. A friend of mine still uses a script to graph that, so I would
have though about this sooner or later.. With you asking it's probably
`sooner' ;)

After all, it's merely a call to `statvfs' (POSIX) or `statfs' (other
UNIX like systems). Don't you just love the creativity these guys
develop when it comes to syscalls? ;)

> In version 3.1 (do I need to update?), the hddtemp rrds are named
> hddtemp-sdb.rrd and hddtemp-8-0.rrd. Why this difference?

collectd tries to resolve the device names (like `sdb') by reading
`/proc/partitions'. There may be a better way to do this, but I don't
know it.. Anyways, if collectd cannot find the device there it simply
uses the `basename' of the string passed to it by `hddtemp'.

If the RRD named `8-0' is the first disk (i.e. `sda') and the second
disk is named `sdb', then check if both disks are in the proc-file
above. If you find any difference between the two please tell me, maybe
I can take that into account.. If you have only one disk and collectd
uses either one of the RRDs, you'll have to keep a copy of the file and
compare the copy with the `live' file when behavior changes. Sorry that
I don't have any other hint for you :/

Regards,
(Continue reading)

Florian Forster | 5 Dec 2005 09:02
Favicon

Re: users plugin

Hello,

On Sun, Dec 04, 2005 at 06:40:29PM +0100, Sebastian Harl wrote:
> I've written a small plugin for collectd which counts the number of users
> logged into the system.

thanks Sebastian :) As you've already written the changes are in the SVN
and everything compiles under Linux and Solaris. I don't know yet if it
works, but since the interface is pretty much identical it's unlikely to
cause any trouble..

Regards,
-octo
--

-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
Jan Huijsmans | 5 Dec 2005 11:19
Picon

Collectd 3.4 not running after update from 3.3

Hello,

I'm currently running a mix of version 3.3 and 3.4 within a debian
etch setup. The mix is mainly because the 3.4 version stopped working
directly after the upgrade. Is there a way to get some logging from 
collectd so I can see what's going wrong?

Also, if someone has the 3.3 deb files, I can perform a roll-back.
I tried to get it via the stable apt url, but this didn't work.

Greetings,

Jan Huijsmans

Florian Forster | 5 Dec 2005 11:48
Favicon

Re: Collectd 3.4 not running after update from 3.3

Hallo Jan,

On Mon, Dec 05, 2005 at 11:19:20AM +0100, Jan Huijsmans wrote:
> The mix is mainly because the 3.4 version stopped working directly
> after the upgrade.

I'm sorry to hear that.. Are you aware that the package has been split
up into many smaller packages, so choosing which modules to use is much
more easily (yet not perfect, I know)?

If that's not the problem you can find old packages here:
<http://verplant.org/debian/dists/stable/collectd/binary-i386/>

Regards,
-octo
--

-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
Jan Huijsmans | 5 Dec 2005 13:20
Picon

Re: Collectd 3.4 not running after update from 3.3

Hallo Octo,

On Mon, Dec 05, 2005 at 11:48:41AM +0100, Florian Forster wrote:
> On Mon, Dec 05, 2005 at 11:19:20AM +0100, Jan Huijsmans wrote:
> > The mix is mainly because the 3.4 version stopped working directly
> > after the upgrade.
> I'm sorry to hear that.. Are you aware that the package has been split
> up into many smaller packages, so choosing which modules to use is much
> more easily (yet not perfect, I know)?

After installing the modules (I should've bin able to find them myself)
everything is working again.

Some tips to improve the debian packaging:

- Add the complete list as suggested packages for collectd
  (with maybe the processes of memory module as required)
- Add an /etc/init.d/collectd restart in the post-install of the
modules

Is it possible to have collectd execute specified scripts for other
data gathering purposes? I have created scripts to count users, gather
filesystem usage and stuff like that. It would be very nice to have those
script executed by collectd.

> If that's not the problem you can find old packages here:
> <http://verplant.org/debian/dists/stable/collectd/binary-i386/>

The problem is solved, so I won't need them, but maybe others could
benefit from the packages.
(Continue reading)

Sebastian Harl | 5 Dec 2005 13:45
Gravatar

executing scripts from collectd (was: Re: Collectd 3.4 not running after update from 3.3)

Hi Jan,

> Is it possible to have collectd execute specified scripts for other
> data gathering purposes? I have created scripts to count users, gather
> filesystem usage and stuff like that. It would be very nice to have those
> script executed by collectd.

There is no possiblity to execute scripts from collectd and I don't think
Florian is ever going to implement a feature like that, as this will slow
things down a lot.

I did write a plugin to count users which was commited to SVN yesterday. Just
have a look at it. If your script is doing more that that, just tell me and
I'm going to try to implement the additional features ;-)

According to an email to this list yesterday, Florian is going to write a
plugin to collect filesystem usage.

Cheers,
--

-- 
Sebastian "tokkee" Harl
GnuPG-ID: 0x8501C7FC
http://tokkee.org/

Florian Forster | 5 Dec 2005 13:51
Favicon

Re: Improving the Debian package

Hello Jan,

On Mon, Dec 05, 2005 at 01:20:31PM +0100, Jan Huijsmans wrote:
> Some tips to improve the debian packaging:
> - Add the complete list as suggested packages for collectd (with maybe
>   the processes of memory module as required)

I've thought about that, too, and will change that soon.. Also, a friend
of mine suggested building a meta-package that pulls in `essential'
modules. I'd rather not depend on any specific module being present, but
rather depend on at least one being there..

> - Add an /etc/init.d/collectd restart in the post-install of the
>   modules

If anyone could tell me how to prevent dpkg to restart collectd $n$
times when installing $n$ packages I'll gladly do this :)

> Is it possible to have collectd execute specified scripts for other
> data gathering purposes?

No, there's no such thing yet and none is planned so far. If you can
life with a limited interface to collectd one could write two modules
`exec_counter' and `exec_gauge' which exec a script/binary, read a
single value back and write it to the RRD file.

I don't see a way to intelligently handle definitions for RRD files from
the outside, so having one `value' DS of either type `COUNTER' or
`GAUGE' would simplify a lot.

(Continue reading)


Gmane