Monitoring Network ports via a Mod-Gearman worker

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Monitoring Network ports via a Mod-Gearman worker

Post by Fred Kroeger »

I have a Mod-Gearman worker sitting behind a firewall to monitor devices located behind that firewall.
All works OK except when I configure Port monitoring for Network Devices. This does work in that perfdata is returned via the worker to the Nagios server.
However, the bandwidth info is stored instead on the worker because that is what the check_xi_service_mrtgtraf command does. This of course means that the Nagios Bandwidth Usage report doesn't work as it can't find the data in /var/lib/mrtg on the Nagios server. Apart from regularly exporting the contents of /var/lib/mrtg from the worker to the server is there anything I can do?
I don't think exporting is the answer either as it is entirely possible that I could get a clash of IP's - the IP's accessed by the worker could also be used locally by the Nagios server or another worker at a different site.

regards.... Fred
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Monitoring Network ports via a Mod-Gearman worker

Post by eloyd »

I can offer no help here, but I can say that I am interested in this topic, so I'm replying so I'll be notified of updates. :-)
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Monitoring Network ports via a Mod-Gearman worker

Post by tmcdonald »

That's a tricky one, and a problem fairly unique to mod_gearman setups. I came to the same conclusion, you'll need to find some way to sync these files between your remote workers and the XI machine. rsync on a cron is a pretty low-hassle method for starters, unfortunately we don't have an official recommendation.
Former Nagios employee
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Monitoring Network ports via a Mod-Gearman worker

Post by eloyd »

I KNEW that's what you were going to say. We're rsyncing now, but don't have to worry about IP space collision. Was hoping for better news.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Monitoring Network ports via a Mod-Gearman worker

Post by tmcdonald »

eloyd wrote:I KNEW that's what you were going to say.
I guess you could say our thoughts were... synced :)

I can definitely leave this open for discussion, but this is one of the drawbacks of using mod_gearman and unless they add in the ability to ship this sort of info back, I can't think of an easy solution.
Former Nagios employee
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Re: Monitoring Network ports via a Mod-Gearman worker

Post by Fred Kroeger »

Thanks. IP Address duplication is going to be my problem. The only solution for me is to create a directory under /var/lib/mrtg for each client and rsync the files there. But then Nagios will need to know to look in these sub directories to produce the bandwidth Utilisation reports
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Monitoring Network ports via a Mod-Gearman worker

Post by Box293 »

Fred Kroeger wrote:Apart from regularly exporting the contents of /var/lib/mrtg from the worker to the server is there anything I can do?
I don't think exporting is the answer either as it is entirely possible that I could get a clash of IP's - the IP's accessed by the worker could also be used locally by the Nagios server or another worker at a different site.
So the files in /var/lib/mrtg are named based on each Target[name_interger] in /etc/mrtg/conf.d/xxx.cfg.

/etc/mrtg/conf.d/firewall1.box293.local.cfg

Code: Select all

### Interface 1 >> Descr: 'em0' | Name: 'em0' | Ip: 'xxx.xxx.x.xxx' | Eth: '00-11-22-33-44-55' ###

Target[firewall1.box293.local_1]: 1:[email protected]:::::2

Code: Select all

ls -al /var/lib/mrtg/firewall1.box293.local_1.rrd 
-rw-r--r-- 1 root root 105312 Mar 18 10:05 /var/lib/mrtg/firewall1.box293.local_1.rrd
/usr/local/nagios/etc/services/firewall1.cfg

Code: Select all

define service {
        host_name                       firewall1
        service_description             em0 - WAN Bandwidth
        use                             xiwizard_switch_port_bandwidth_service
        check_command                   check_xi_service_mrtgtraf!firewall1.box293.local_1.rrd!500,500!800,800!M

So you can avoid a clash of IP's by using the FQDN of the objects being monitoring when running the switch / router wizard.

With all of this in mind, /var/lib/mrtg/ can be an NFS share that is mounted on XI and all the workers, or done via rsync like you are now.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Monitoring Network ports via a Mod-Gearman worker

Post by eloyd »

For the customer of ours where this applies, they are putting mod_gearman boxes in different customer sites, all separate and unique with no way to ensure lack of overlap on IPs and very few FQDNs in use (mainly for switching fabric devices). So we'll be rsyncing until it breaks, I guess, or do something else.

I'm thinking we might just put Nagios Core boxes in each site instead of mod_gearman, and then report back to a centralized Nagios XI server for reporting, but install Fusion for them to be able to query all the Core boxes as well. Plus, we get to sell them some more licenses that way. :-)
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Monitoring Network ports via a Mod-Gearman worker

Post by rkennedy »

@Fred - let us know if you have any further questions.
Former Nagios Employee
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Monitoring Network ports via a Mod-Gearman worker

Post by eloyd »

Okay, for what it's worth, I'm done with this topic. If OP wants to close it, don't let me stop you.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Locked