OPNsense Forum

Archive => 21.1 Legacy Series => Topic started by: Luc3k on February 13, 2021, 06:15:45 pm

Title: Help with configuration Munin
Post by: Luc3k on February 13, 2021, 06:15:45 pm
I installed os-munin-node plugin.
Configuration on GUI looks like on screen below. However, the statistics in the browser are not generated .
Plugins in /usr/local/etc/munin/plugins are created (screenshot below) using command "munin-node-configure --suggest" and "/usr/local/sbin/munin-node-configure --shell"
What is configured wrong that the statistics are not showing? I am asking for tips, I have been working on this problem all afternoon today.

OPNsense in version 21.1.1

munin-node.conf
Code: [Select]
log_level 4
log_file /var/log/munin/munin-node.log
pid_file /var/run/munin/munin-node.pid
background 1
setsid 1
user root
group wheel
# Regexps for files to ignore
ignore_file [\#~]$
ignore_file DEADJOE$
ignore_file \.bak$
ignore_file %$
ignore_file \.dpkg-(tmp|new|old|dist)$
ignore_file \.rpm(save|new)$
ignore_file \.pod$
ignore_file \.sample$

host_name Bravo
cidr_allow 192.168.14.0/16

host *
port 4949

/var/log/munin-node.log
Code: [Select]
2021/02/13-18:05:13 Munin::Node::Server (type Net::Server::Fork) starting! pid(72790)
Resolved [*]:4949 to [::]:4949, IPv6
Resolved [*]:4949 to [0.0.0.0]:4949, IPv4
Binding to TCP port 4949 on host :: with IPv6
Binding to TCP port 4949 on host 0.0.0.0 with IPv4
Setting gid to "0 0"
2021/02/13-18:06:51 CONNECT TCP Peer: "[192.168.14.20]:56691" Local: "[192.168.14.1]:4949"
2021/02/13-18:06:52 CONNECT TCP Peer: "[192.168.14.20]:56692" Local: "[192.168.14.1]:4949"
2021/02/13-18:07:16 CONNECT TCP Peer: "[192.168.14.20]:56693" Local: "[192.168.14.1]:4949"

Portprobe
Code: [Select]
/usr/bin/nc -w 10 -z  -4 '192.168.14.1' '4949'
Connection to 192.168.14.1 4949 port [tcp/*] succeeded!
Title: Re: Help with configuration Munin
Post by: afan on February 14, 2021, 09:32:13 am
Did you have look at the troubleshooting section of munin on http://guide.munin-monitoring.org/en/latest/tutorial/troubleshooting.html?

Particularly the telnet/nc connection is an important one to verify: if plugins are listed and if results can be fetched, then the issue is likely on the master, if no plugins are listed then it's for sure on the client.

Code: [Select]
$ nc 10.0.10.1 4949
# munin node at OPNsense-v1
list
cpu df df_inode if_em0 if_errcoll_em0 if_errcoll_pppoe2 if_errcoll_pppoe3 if_errcoll_vmx0 if_errcoll_vmx1 if_errcoll_vmx2 if_errcoll_vmx3 if_errcoll_vmx4 if_errcoll_vmx5 if_errcoll_vmx6 if_errcoll_vmx7 if_errcoll_vmx8 if_packets_em0 if_packets_pppoe2 if_packets_pppoe3 if_packets_vmx0 if_packets_vmx1 if_packets_vmx2 if_packets_vmx3 if_packets_vmx4 if_packets_vmx5 if_packets_vmx6 if_packets_vmx7 if_packets_vmx8 if_pppoe2 if_pppoe3 if_vmx0 if_vmx1 if_vmx2 if_vmx3 if_vmx4 if_vmx5 if_vmx6 if_vmx7 if_vmx8 iostat load memory netstat ntp_kernel_err ntp_kernel_pll_freq ntp_kernel_pll_off ntp_offset ntp_states open_files swap systat uptime users
fetch cpu
user.value 384068
nice.value 0
system.value 712836
interrupt.value 21338
idle.value 167495170
.

I see you attempted a port probe but did not try to do a 'list' or 'fetch cpu' for example.

If all looks fine, next step I'd take is to manually run the service from the munin user on the master:

Code: [Select]
root@server:~# su - munin --shell=/bin/bash
munin@server:~$ /usr/share/munin/munin-update --debug --nofork --host OPNsense.mydomain.com
2021/02/14 09:25:43 [DEBUG] Creating new lock file /var/run/munin/munin-update.lock
2021/02/14 09:25:43 [DEBUG] Creating lock : /var/run/munin/munin-update.lock succeeded
2021/02/14 09:25:43 [INFO]: Starting munin-update
2021/02/14 09:25:46 [DEBUG] Creating new lock file /var/run/munin/munin-mydomain.com-OPNsense.mydomain.com.lock
2021/02/14 09:25:46 [DEBUG] Creating lock : /var/run/munin/munin-mydomain.com-OPNsense.mydomain.com.lock succeeded
2021/02/14 09:25:46 [DEBUG] Reading state for mydomain.com-OPNsense.mydomain.com in /var/lib/munin/state-mydomain.com-OPNsense.mydomain.com.storable
2021/02/14 09:25:46 [INFO] starting work in 15868 for OPNsense.mydomain.com/10.0.10.1:4949.
2021/02/14 09:25:46 TLS set to "disabled".
2021/02/14 09:25:46 [DEBUG] Negotiating capabilities
2021/02/14 09:25:46 [DEBUG] Writing to socket: "cap multigraph dirtyconfig
".
2021/02/14 09:25:46 [DEBUG] Node says /cap multigraph dirtyconfig/
2021/02/14 09:25:46 [DEBUG] Writing to socket: "list OPNsense-v1
".
2021/02/14 09:25:46 [DEBUG] for my if_errcoll_vmx5 (if_errcoll_vmx5 if_errcoll_vmx1 if_packets_vmx8 df if_packets_vmx6 if_em0 if_vmx3 if_vmx2 if_errcoll_pppoe3 ntp_kernel_pll_freq ntp_kernel_err if_vmx7 if_errcoll_vmx8 if_packets_vmx5 if_packets_vmx1 ntp_kernel_pll_off users load if_vmx8 if_errcoll_vmx6 if_packets_pppoe3 if_vmx1 if_vmx5 ntp_offset if_errcoll_vmx2 if_pppoe2 open_files if_packets_vmx7 iostat swap if_errcoll_vmx0 memory if_packets_vmx4 uptime if_packets_vmx3 netstat if_packets_pppoe2 if_pppoe3 if_packets_em0 if_errcoll_vmx7 ntp_states if_packets_vmx2 if_vmx0 if_packets_vmx0 if_vmx4 systat df_inode cpu if_errcoll_vmx4 if_errcoll_em0 if_errcoll_vmx3 if_errcoll_pppoe2 if_vmx6)
2021/02/14 09:25:46 [DEBUG] Fetching service configuration for 'if_errcoll_vmx5'
2021/02/14 09:25:46 [DEBUG] Writing to socket: "config if_errcoll_vmx5
".
2021/02/14 09:25:46 [DEBUG] Reading from socket: "graph_order ierrors oerrors collisions\ngraph_title vmx5 Errors & Collisions\ngraph_args --base 1000\ngraph_vlabel events / ${graph_period}\ngraph_category network\ngraph_info This graph shows the amount of errors and collisions on the vmx5 network interface.\nierrors.label Input Errors\nierrors.type COUNTER\noerrors.label Output Errors\noerrors.type COUNTER\ncollisions.label Collisions\ncollisions.type COUNTER".
2021/02/14 09:25:46 [DEBUG] config: 0.05001 sec for 'if_errcoll_vmx5' on OPNsense.mydomain.com/10.0.10.1/4949
2021/02/14 09:25:46 [DEBUG] Now parsing config output from plugin if_errcoll_vmx5 on OPNsense.mydomain.com
2021/02/14 09:25:46 [DEBUG] update_rate 0 for if_errcoll_vmx5 on OPNsense.mydomain.com/10.0.10.1:4949
2021/02/14 09:25:46 [DEBUG] No service data for if_errcoll_vmx5, fetching it
2021/02/14 09:25:46 [DEBUG] Writing to socket: "fetch if_errcoll_vmx5
".
2021/02/14 09:25:46 [DEBUG] data: 0.045926 sec for 'if_errcoll_vmx5' on OPNsense.mydomain.com/10.0.10.1/4949
2021/02/14 09:25:46 [DEBUG] Now parsing fetch output from plugin if_errcoll_vmx5 on OPNsense.mydomain.com/10.0.10.1:4949
2021/02/14 09:25:46 [FETCH from if_errcoll_vmx5] ierrors.value 0
2021/02/14 09:25:46 [FETCH from if_errcoll_vmx5] Storing 0 in ierrors
2021/02/14 09:25:46 [FETCH from if_errcoll_vmx5] oerrors.value 0
2021/02/14 09:25:46 [FETCH from if_errcoll_vmx5] Storing 0 in oerrors
2021/02/14 09:25:46 [FETCH from if_errcoll_vmx5] collisions.value 0
2021/02/14 09:25:46 [FETCH from if_errcoll_vmx5] Storing 0 in collisions
2021/02/14 09:25:46 [DEBUG] asking for a rrd of size : normal
(and so on)
Title: Re: Help with configuration Munin
Post by: Luc3k on February 14, 2021, 09:47:39 am
the "nc 192.168.14.1 4949" command returns the following response:
Code: [Select]
root@Bravo:~ # nc 192.168.14.1 4949
# munin node at Bravo
list
cpu df df_inode hddtemp_smartctl if_bge0 if_bge1 if_errcoll_bge0 if_errcoll_bge1 if_packets_bge0 if_packets_bge1 iostat load memory netstat ntp_193.219.28.2 ntp_213.199.225.40 ntp_54.37.233.160 ntp_94.23.94.78 ntp_kernel_err ntp_kernel_pll_freq ntp_kernel_pll_off ntp_offset ntp_states open_files smart_ada0 swap systat uptime users
I think that is the correct answer. What is your opinion? 

I still don't know where exactly should I put it :
Code: [Select]
[OPNsense.mydomain.local]
        address 10.0.10.1
        use_node_name yes

/usr/local/etc/munin/munin-node.conf?
Title: Re: Help with configuration Munin
Post by: afan on February 15, 2021, 08:55:58 am
the "nc 192.168.14.1 4949" command returns the following response:
Code: [Select]
root@Bravo:~ # nc 192.168.14.1 4949
# munin node at Bravo
list
cpu df df_inode hddtemp_smartctl if_bge0 if_bge1 if_errcoll_bge0 if_errcoll_bge1 if_packets_bge0 if_packets_bge1 iostat load memory netstat ntp_193.219.28.2 ntp_213.199.225.40 ntp_54.37.233.160 ntp_94.23.94.78 ntp_kernel_err ntp_kernel_pll_freq ntp_kernel_pll_off ntp_offset ntp_states open_files smart_ada0 swap systat uptime users
I think that is the correct answer. What is your opinion? 
Yep looks good.

I still don't know where exactly should I put it :
Code: [Select]
[OPNsense.mydomain.local]
        address 10.0.10.1
        use_node_name yes

/usr/local/etc/munin/munin-node.conf?
Nope, just in the host definition section under munin.conf. The munin-node.conf file contains config of the node (client). Munin.conf is the one for the master.
In munin.conf you'd typically have an entry for the master itself, like:

Code: [Select]
[Monitoring.mydomain.local]
        address 127.0.0.1
        use_node_name yes
        hddtemp.sda.critical 60
        hddtemp.sdb.critical 60

And then you just add another one:

Code: [Select]
[OPNsense.mydomain.local]
        address 10.0.10.1
        use_node_name yes

Once you have this set, you should be able to use "/usr/share/munin/munin-update --debug --nofork --host OPNsense.mydomain.local" if things aren't working yet, and inspect for errors.