DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2010-12-12 01:36:16

adambyrtek
Member
Registered: 2010-12-12
Posts: 27

New Munin node package (patch included)

Munin is a lightweight monitoring system that I use to monitor all my machines. I wanted to fetch statistics from the DNS-323 as well, so I created a funpkg package with the Munin node, a daemon that serves the information about a machine. Feel free to add the package to the distribution (credits appreciated).

The packages is attached and a patch against the Subversion repository is available at
https://gist.github.com/737455

The description of the package

Code:

Munin the monitoring tool surveys all your computers and remembers what it saw.
It presents all the information in graphs through a web interface. Its emphasis
is on plug and play capabilities. After completing a installation a high number
of monitoring plugins will be playing with no more effort.

Using Munin you can easily monitor the performance of your computers, networks,
SANs, applications, weather measurements and whatever comes to mind. It makes
it easy to determine "what's different today" when a performance problem crops
up. It makes it easy to see how you're doing capacity-wise on any resources.

This package contains a Munin node that serves monitoring data in response to
requests from a Munin master that has to be installed separately. It depends on
perl and perl-mod-Net-Server.

After installation you can either run

  $ perl /ffp/sbin/munin-node-configure --shell | sh -x

to autodetect available plugins or configure the plugins manually.

Regards,
Adam Byrtek

Last edited by adambyrtek (2010-12-14 01:51:28)


Attachments:
Attachment Icon munin-node-1.4.5-2.tgz, Size: 332,340 bytes, Downloads: 503

Offline

 

#2 2010-12-13 23:13:21

adambyrtek
Member
Registered: 2010-12-12
Posts: 27

Re: New Munin node package (patch included)

I'm attaching a Net::Server Perl module that is required as a dependency.


Attachments:
Attachment Icon perl-mod-Net-Server-0.99-1.tgz, Size: 104,584 bytes, Downloads: 481

Offline

 

#3 2010-12-14 15:11:58

adambyrtek
Member
Registered: 2010-12-12
Posts: 27

Re: New Munin node package (patch included)

I found a bug in ffp startup scripts that prevents /ffp/start/munin-node.sh from detecting a running munin-node process. This means that you will be able to start a process, but it won't be possible to stop it using the script. Of course you can always use "killall munin-node" to achieve the same goal.

Patch that fixes this can be found at https://gist.github.com/740382

Last edited by adambyrtek (2010-12-14 15:15:34)

Offline

 

#4 2011-04-15 11:10:35

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

Re: New Munin node package (patch included)

I've tried to get munin working last night but with not much luck. Following your guide from the Wiki, munin-node-configure found a problem with every single (default) plugin and hence didn't produce any symlinks for installation.

I've dug around a bit and modified some of the code to see what is happening.

I've discovered that the plugins are normal shell scripts (not perl), and they execute just fine (I tested 'cpu').
When I manually create a symlink for this plugin to /ffp/etc/munin/plugins/cpu and then call 'perl -T /ffp/sbin/munin-run cpu', I get the error "cpu: applet not found".

Now, that error message does not appear anywhere in the munin sources. I found out that it is actually a message produced by busybox, which provides the default shell (/ffp/bin/sh).


Now I'm out of ideas: I believe Munin at startup time resolves the symlink '/ffp/bin/sh' to '/ffp/bin/busybox', and later, when it calls "exec /ffp/etc/munin/plugins/cpu", the call somehow gets transformed to '/ffp/bin/busybox /ffp/etc/munin/plugins/cpu'.
Of course, "cpu" is not a busybox module, which is why I get the message "applet not found".

I couldn't find any similar issues on Google. Any idea what might be wrong here, and what I can do to fix it?

Offline

 

#5 2011-04-16 20:05:21

oracle_sod
New member
Registered: 2011-04-16
Posts: 3

Re: New Munin node package (patch included)

Im also having the same issue as KyleK

when i run  perl /ffp/sbin/munin-node-configure --shell | sh -x i get the following errors:



Code:

# The following plugins caused errors:
# acpi:
#       Non-zero exit during autoconf (1)
#       Junk printed to stderr
# amavis:
#       Non-zero exit during autoconf (1)
#       Junk printed to stderr
# apache_accesses:
#       Junk printed to stderr
# apache_processes:
#       Junk printed to stderr
# apache_volume:
#       Junk printed to stderr
# apc_envunit_:
#       Non-zero exit during autoconf (1)
#       Junk printed to stderr
# bonding_err_:
#       Non-zero exit during autoconf (1)
#       Junk printed to stderr
# courier_mta_mailqueue:
#       Non-zero exit during autoconf (1)
#       Junk printed to stderr
# courier_mta_mailstats:
#       Junk printed to stderr
# courier_mta_mailvolume:
#       Junk printed to stderr
# cps_:
#       Junk printed to stderr
# cpu:
#       Non-zero exit during autoconf (1)
#       Junk printed to stderr

if i run
/ffp/share/munin/plugins/cpu
i get:

Code:

/ffp/share/munin/plugins/cpu: .: line 100: can't open /plugins/plugin.sh

if i run
ln -s /ffp/share/munin/plugins/cpu /ffp/etc/munin/plugins/cpu
perl -T /ffp/sbin/munin-run cpu
i get:

Code:

Use of uninitialized value $dg in concatenation (.) or string at /ffp/lib/perl5/site_perl/5.10.0/Munin/Node/Service.pm line 161.
Use of uninitialized value $dg in concatenation (.) or string at /ffp/lib/perl5/site_perl/5.10.0/Munin/Node/Service.pm line 161.
Use of uninitialized value $dg in numeric eq (==) at /ffp/lib/perl5/site_perl/5.10.0/Munin/Node/Service.pm line 168.
Use of uninitialized value $dg in numeric eq (==) at /ffp/lib/perl5/site_perl/5.10.0/Munin/Node/Service.pm line 174.
cpu: applet not found

any ideas ???

Offline

 

#6 2011-04-19 14:29:34

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

Re: New Munin node package (patch included)

I think I found the cause of the problem.
The plugins/scripts in /ffp/share/munin/plugins that are shell scripts (rather than perl scripts) have a incomplete (?) shebang:

Code:

#!
# -*- sh -*-

I'm not sure if this is because of a make error when the scripts got generated (are they generated?) or if funplug/ffp simply handles this form of a shebang incorrectly. (Is it even a valid shebang?)

Anyway, changing it to:

Code:

#!/ffp/bin/sh

makes the errors go away smile

Offline

 

#7 2011-04-19 21:47:59

oracle_sod
New member
Registered: 2011-04-16
Posts: 3

Re: New Munin node package (patch included)

should i be editing plugins.sh or the individual files like 'cpu' ?

either way looks like i get the similar errors... although perl -T /ffp/sbin/munin-run cpu now gives:

Code:

Use of uninitialized value $dg in concatenation (.) or string at /ffp/lib/perl5/site_perl/5.10.0/Munin/Node/Service.pm line 161.
Use of uninitialized value $dg in concatenation (.) or string at /ffp/lib/perl5/site_perl/5.10.0/Munin/Node/Service.pm line 161.
Use of uninitialized value $dg in numeric eq (==) at /ffp/lib/perl5/site_perl/5.10.0/Munin/Node/Service.pm line 168.
Use of uninitialized value $dg in numeric eq (==) at /ffp/lib/perl5/site_perl/5.10.0/Munin/Node/Service.pm line 174.
user.value 11507
nice.value 0
system.value 6819
idle.value 1752505
iowait.value 883
irq.value 1
softirq.value 358
steal.value 0

so its replying with data... but still errored....

i have also noticed that when i run perl /ffp/sbin/munin-node-configure --shell | sh -x , cpu now gives

Code:

# cpu:
#       Junk printed to stderr

where as before the error was

Code:

# cpu:
#       Non-zero exit during autoconf (1)
#       Junk printed to stderr

Offline

 

#8 2011-04-27 17:56:17

oracle_sod
New member
Registered: 2011-04-16
Posts: 3

Re: New Munin node package (patch included)

anyone got any ideas ? sad

Offline

 

#9 2011-08-02 21:58:28

nlebas
New member
Registered: 2011-08-02
Posts: 1

Re: New Munin node package (patch included)

I just ran the following commands and it worked.
Thanks KyleK!

Code:

# cd /ffp/share/munin/plugins
# perl -ni -e 'print "#!/ffp/bin/sh\n" if /^#!$/;print;' *
# perl -X /ffp/sbin/munin-node-configure --shell | sh -x

Last edited by nlebas (2011-08-02 22:01:48)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB