[collectd] where to write data from external script

Stefan Arn arnstefan at gmail.com
Tue Feb 3 14:05:22 CET 2009


Thank you very much, it works with your explanations :-)

On Tue, Feb 3, 2009 at 11:57 AM, Sebastian Harl <sh at tokkee.org> wrote:
> Hi Stefan,
>
> On Tue, Feb 03, 2009 at 11:37:25AM +0100, Stefan Arn wrote:
>> I want to monitor how many discs are marked as online on my raid
>> controller. So far I use a commandline tool for that. I wrote a little
>> shell script which returns:
>>
>> PUTVAL localhost/raid/discs N:2
>>
>> Nummer 2 is the actual number of the discs online. the rest is from
>> your documentation, though I think the raid/discs part is wrong.
>
> "raid" is fine - this is just some arbitrary string that's supposed to
> help you identify the data. Usually, that part is of the form <plugin>-
> <plugin_instance>, so in this case, this could e.g. be exec-raid ("exec"
> is the name of the plugin) but this is just convention - collectd does
> not care about that at all as long as it's unique (if it's not, you'll
> get error messages like "uc_update: Value too old" in the logs).
>
> "discs" identifies the layout of the data you're dispatching to
> collectd, so an arbitrary string won't work here. See the types.db(5)
> manpage for more details about how to define data types. In your case,
> you'd want a GAUGE type, since your values do not continuously increase.
> You could either use a generic, pre-defined type like "gauge" or define
> your own type in a second types.db file and add that file to the
> "TypesDB" config option _in_ _addition_ to the default types.db file.
> So, your line might e.g. look like that:
>
>  PUTVAL localhost/exec-raid/gauge N:2
>
>> Further I added the exec plugin and configured it to work with my script:
>>
>> LoadPlugin exec
>> <Plugin exec>
>>         Exec "root:root" "/opt/MegaRAID/MegaCli/raiddiscsonline.sh"
>> </Plugin>
>
> That won't work - the exec plugin refuses to execute a script as root.
> If you need additional privileges, e.g. use sudo in your script. Else,
> that config looks fine.
>
> HTH,
> Sebastian
>
> --
> Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/
>
> Those who would give up Essential Liberty to purchase a little Temporary
> Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFJiCMnEFEKc4UBx/wRAqyLAKCOssLaWpmwFOdES59v7p7ZmUtUtQCfQCSD
> kVdvgWSJsZx2by8ImN0I0WE=
> =cm6V
> -----END PGP SIGNATURE-----
>
>



More information about the collectd mailing list