Monitoring Bandwidth using NWC Health Check

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
silentnoise
Posts: 20
Joined: Tue Jun 02, 2020 3:51 pm

Monitoring Bandwidth using NWC Health Check

Post 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
silentnoise
Posts: 20
Joined: Tue Jun 02, 2020 3:51 pm

Re: Monitoring Bandwidth using NWC Health Check

Post 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.
User avatar
rhassing
Posts: 412
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: Monitoring Bandwidth using NWC Health Check

Post 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
Rob Hassing
Image
silentnoise
Posts: 20
Joined: Tue Jun 02, 2020 3:51 pm

Re: Monitoring Bandwidth using NWC Health Check

Post by silentnoise »

But how do i have to integrate it into nagios?
User avatar
rhassing
Posts: 412
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: Monitoring Bandwidth using NWC Health Check

Post 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.
Rob Hassing
Image
silentnoise
Posts: 20
Joined: Tue Jun 02, 2020 3:51 pm

Re: Monitoring Bandwidth using NWC Health Check

Post 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 ?
silentnoise
Posts: 20
Joined: Tue Jun 02, 2020 3:51 pm

Re: Monitoring Bandwidth using NWC Health Check

Post 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)
silentnoise
Posts: 20
Joined: Tue Jun 02, 2020 3:51 pm

Re: Monitoring Bandwidth using NWC Health Check

Post 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
silentnoise
Posts: 20
Joined: Tue Jun 02, 2020 3:51 pm

Re: Monitoring Bandwidth using NWC Health Check

Post by silentnoise »

Hello again :)
The script is running.

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

Greets
Attachments
Speed
Speed
User avatar
rhassing
Posts: 412
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: Monitoring Bandwidth using NWC Health Check

Post 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.
Rob Hassing
Image
Locked