Page 1 of 2

Monitoring Bandwidth using NWC Health Check

Posted: Fri May 21, 2021 3:27 am
by silentnoise
Hi,

i have another problem.
I would like to check the used bandwidth on my cable-internet-connection usiung nwc health check in nagios to monitor the bandwidth on my Fritz!Box.

I used the Manual on:
http://www.schroeter-edv.de/?Dokumentat ... r_FritzBox

But it doesn`t work.

In this manual i have to copy the exec-file into dir:
sudo mv plugins-scripts/check_nwc_health /usr/lib/nagios/plugins/
but the directory /usr/lib/nagios does`nt exist.

There ist an Directory: "usr/local/nagios/libexec"
Is this the correct directory ?

Greets

Re: Monitoring Bandwidth using NWC Health Check

Posted: Fri May 21, 2021 3:37 am
by silentnoise
I´m able to run commands using command line:

/usr/local/nagios/libexec $ ./check_nwc_health --hostname 192.168.178.1 --port 49000 uptime --community "my Password"

it says:
./check_nwc_health --hostname 192.168.178.1 --port 49000 --mode uptime --community XXXXXXXXX
OK - device is up since 7d 15h 5m 16s, FRITZ!Box 6490 Cable (kdg) | 'uptime'=10985;15:;5:;;

So i know this is only the uptime, but i want to show, that nwc health check is running correctly.

Re: Monitoring Bandwidth using NWC Health Check

Posted: Sun May 23, 2021 4:03 am
by rhassing
I have checked out this plugin as well.

You should be able to check the interface usage:

Code: Select all

./check_nwc_health --hostname 192.168.178.1 --port 49000 --mode interface-usage --community <passowrd>
The other checks described on the example page, memory usage and cpu load are not working very well

Re: Monitoring Bandwidth using NWC Health Check

Posted: Sun May 23, 2021 4:07 am
by silentnoise
But how do i have to integrate it into nagios?

Re: Monitoring Bandwidth using NWC Health Check

Posted: Sun May 23, 2021 4:17 am
by rhassing
Edit /usr/local/nagios/etc/resource.cfg and add the your password

Code: Select all

$USER4$=fritzbox-password
Add the config to nagios:

Code: Select all

define host {
  use generic-host
  host_name fritzbox
  alias fritzbox
  address <ip-fritzbox>
}
define service {
  use generic-service
  host_name fritzbox
  service_description Interface Usage
  check_command check_fritz!49000!interface-usage
}
Add the command to your command file:

Code: Select all

define command{
   command_name check_fritz
   command_line $USER1$/check_nwc_health --hostname $HOSTADDRESS$ --port $ARG1$ --mode $ARG2$ --community $USER4$
 }
The script is trying to write some data in /var/tmp/check_nwc_health
Make sure the nagios user is able to write in there.

Re: Monitoring Bandwidth using NWC Health Check

Posted: Sun May 23, 2021 6:43 am
by silentnoise
The script is trying to write some data in /var/tmp/check_nwc_health
Make sure the nagios user is able to write in there.[/quote]




How will i check this ?

Re: Monitoring Bandwidth using NWC Health Check

Posted: Sun May 23, 2021 6:46 am
by silentnoise
Is here any failure ?

https://ibb.co/Rgmh3HF -> commands.cfg

https://ibb.co/X5y8xp8 -> fritzbox.cfg (host)

https://ibb.co/s2y5cz7 -> resource.cfg

https://ibb.co/b301WgK -> fritzbox.cfg (service)

Re: Monitoring Bandwidth using NWC Health Check

Posted: Sun May 23, 2021 7:12 am
by silentnoise
I´m sorry.
I`m one step closer to finish :)


The script is running in nagios.
but it says:
https://ibb.co/pbYWkHn

Re: Monitoring Bandwidth using NWC Health Check

Posted: Mon May 24, 2021 4:23 am
by silentnoise
Hello again :)
The script is running.

How can i change the output from bis/s to Mbit/s?

Greets

Re: Monitoring Bandwidth using NWC Health Check

Posted: Tue May 25, 2021 9:49 am
by rhassing
silentnoise wrote:Hello again :)
The script is running.

How can i change the output from bis/s to Mbit/s?

Greets
With the option -units MB it should be possible to change the output.