Unbound and hobbit / xymon

Hi :slight_smile:

I try to get statistics from unbound to hobbit aka xymon.

I know there is a plugin for Munin.. but it's not quite what I need.

Do you tried before the combination unbound & xymon?

Can you give me a clue , direction?

Thank you:)

Gabi

Hi Gabi.

I found this tutorial about how to setup custom graphs in Xymon:
http://www.hobbitmon.com/hobbit/help/howtograph.html
From the example of custom scripts I can see that Xymon expects input in
format of "name : value", where each pair should be on new line.
In the given example, script what parse /proc/slabinfo generates this output:
inode_cache : 7100160
dentry_cache : 752640
...etc

When you run unbound-control stats command it produces output in this format:
thread0.num.queries=0
thread0.num.cachehits=0
thread0.num.cachemiss=0
thread0.recursion.time.avg=0.000000
...etc

All you need to do is sed stats output:
unbound-control stats | sed s/=/" : "/
thread0.num.queries : 0
thread0.num.cachehits : 0
thread0.num.cachemiss : 0
thread0.recursion.time.avg : 0.000000
...etc

Or, if dots in variables names are unvanted use this:
unbound-control stats | awk -F '=' '{gsub(/\./,"_",$1);print($1" : "$2)}'
thread0_num_queries : 0
thread0_num_cachehits : 0
thread0_num_cachemiss : 0
thread0_recursion_time_avg : 0.000000
...etc

Hi Dmitriy,

Thank you for oyur answer:)

It clarified a part of my issue.

MY architecture is:

an unbound dns server with a hobbit client.
the hobbit client should run a script which gets data somehow from unbound dns and than send it to hobbit server.

[hobbit or xymon is the same application, the name difference is based on some copyright issues.]

about running unbound-control stat command

here I get several errors:

root@unbound3:~# unbound-control start
root@unbound3:~# unbound-control stats
error: Error setting up SSL_CTX client key and cert
4281:error:02001002:system library:fopen:No such file or directory:bss_file.c:352:fopen(‘/var/unbound/usr/local/etc/unbound/unbound_control.pem’,‘r’)
4281:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:354:
4281:error:140AD002:SSL routines:SSL_CTX_use_certificate_file:system lib:ssl_rsa.c:470:

I used the tutorial from:

http://www.howtoforge.com/installing-using-unbound-nameserver-on-debian-etch

in config file: I have the following:

remote-control:

control-enable: yes

what interfaces are listened to for remote control.

give 0.0.0.0 and ::0 to listen to all interfaces.

control-interface: 127.0.0.1

control-interface: ::1

port number for remote control operations.

control-port: 953

unbound server key file.

server-key-file: “/usr/local/etc/unbound/unbound_server.key”

unbound server certificate file.

server-cert-file: “/usr/local/etc/unbound/unbound_server.pem”

unbound-control key file.

control-key-file: “/usr/local/etc/unbound/unbound_control.key”

unbound-control certificate file.

control-cert-file: “/usr/local/etc/unbound/unbound_control.pem”

based on the info I have here: http://unbound.net/documentation/howto_setup.html

it should be fine

I am using ubuntu server, latest version.

Thank you for any ideea, help:)

Gabi

I made a fresh install on ubuntu, using the example here:

http://www.howtoforge.com/installing-using-unbound-nameserver-on-debian-etch

after that, i added in config file the info from:

http://www.unbound.net/documentation/howto_setup.html

so, if i make a hoobit script where i run the unbound-control set and than replace

Hi Gabriel,

Did you run unbound-control-setup to generate the key files?

It seems like it cannot read
/var/unbound/usr/local/etc/unbound/unbound_control.pem. Could this be
due to a chroot: "/var/unbound" setting; do you have that? Can the
unbound server read the keys?

Where are the key files on your system? What is the config file that
unbound-control uses (unbound-control -h shows the name)? Is that the
correct config file?

Best regards,
   Wouter

Gabriel Petrescu wrote:

Hi:)

I used unbound-control-setup to generate the keys; they are located in: /usr/local/etc/unbound/

using the tutorial from: http://www.howtoforge.com/installing-using-unbound-nameserver-on-debian-etch

i’ve noticed the installed unbound.conf file is in /usr/local/etc/unbound/unbound.conf ; which is used by the system

and in tutorial shpould be in /var/unbound/unbound.conf

at this momemnt I have no clue what’s woring.. no info in logs..

Gabi

Hi Gabriel,

It is very simply really, unbound-control complains that it cannot open
a file. This file is created by unbound-control-setup ; but by default
that probably put it in /usr/local/etc/ like the system defaults, and
not in /var/unbound like in your tutorial.

Copy or symlink the files unbound_control.pem (*pem and *key) from where
they are now.

If you set chroot: "" in your config; some pathname mangling is
disabled, and this may make things work. The right thing is to copy the
files, though.

Best regards,
   Wouter

Gabriel Petrescu wrote:

Hi Gabriel.

Some extra hints to you (I just remember about them).

First hint - unbound-control stats for many of it's output variables produce
statistics in dynamic way. For example - if you server didn't have queues for
A type records then `unbound-control stats` output will not contains any
string for num.query.type.A=. And by default, then this dynamical variables
are queued (then `unbound-control stats` command is executed) they are
cleared from output again.
So, if hobbit expects that some variable always *should* be in output - you
should take this behavior in account.

Second hint - if you wanna to implement historgam graph in hobbit you should
think how to merge output from histogram.000000.000000.to.000000.000000 type
variables because there is so many of them...

This two problems can be fixed by using script what will do parsing of
`unbound-control output`. Take a look at this archive:
http://unbound.nlnetlabs.nl/svn/trunk/contrib/unbound_cacti.tar.gz

Archive contains unbound_cacti parsing script. I think it would be quite easy
to adopt it for hobbit.

Good luck.