Switch wizard adding everything except entry in mrtg.cfg

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: Switch wizard adding everything except entry in mrtg.cfg

Post by snapon_admin »

No, not about this particular host. I get a couple of warnings about 2 hosts that are no longer in Nagios, but that's just because I haven't removed them from the mrtg.cfg file yet.

Edit: For good measure I removed those 2 hosts that no longer exist anyway, and now I get no errors or warnings when I run that command.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Switch wizard adding everything except entry in mrtg.cfg

Post by sreinhardt »

At it again are we? :P Since your permissions look fine on the mrtg.conf file, what are the permissions on the directory?

Code: Select all

ll -d /etc/mrtg
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: Switch wizard adding everything except entry in mrtg.cfg

Post by snapon_admin »

Haha, yep. This time is final though. I told the other net admin if we go back to mrtg we're staying there, lol. So now I just need to make it work and we'll be good.

Code: Select all

[root@lisl-ngos-01-pv mrtg]# ll -d /etc/mrtg
drwxrwxr-x. 4 apache nagios 4096 Feb 28 12:32 /etc/mrtg
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Switch wizard adding everything except entry in mrtg.cfg

Post by sreinhardt »

Do you have selinux enabled? My guess is no, but that period at the end of your command says that the folder here has extended context permissions set for that folder at the very least, which could cause issues.

Code: Select all

ll -Zd /etc/mrtg
ll -Z /etc/mrtg
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: Switch wizard adding everything except entry in mrtg.cfg

Post by snapon_admin »

Code: Select all

[root@lisl-ngos-01-pv mrtg]# ll -Zd /etc/mrtg
drwxrwxr-x. apache nagios system_u:object_r:mrtg_etc_t:s0  /etc/mrtg
[root@lisl-ngos-01-pv mrtg]# ll -Z /etc/mrtg
drwxrwxr-x. apache nagios unconfined_u:object_r:mrtg_etc_t:s0 bkp_cfg
drwxrwxr-x. apache nagios unconfined_u:object_r:mrtg_etc_t:s0 conf.d
-rwxrwxr-x. apache nagios unconfined_u:object_r:mrtg_etc_t:s0 mrtg.bkp
-rwxrwxr-x. apache nagios system_u:object_r:mrtg_etc_t:s0  mrtg.cfg
-rwxrwxr-x. apache nagios unconfined_u:object_r:mrtg_etc_t:s0 mrtg.cfg.bkp
-rwxrwxr-x. apache nagios unconfined_u:object_r:mrtg_etc_t:s0 mrtg.cfg_l_16654
-rwxrwxr-x. apache nagios unconfined_u:object_r:mrtg_etc_t:s0 mrtg.ok
-rwxrwxr-x. apache nagios system_u:object_r:mrtg_etc_t:s0  router.cfg
-rwxrwxr-x. apache nagios system_u:object_r:mrtg_etc_t:s0  router.ok
-rwxrwxr-x. apache nagios unconfined_u:object_r:mrtg_etc_t:s0 separate_mrtg_cfgs
And remember I'm still learning on the fly with linux, but I learn fast. I think this is how to check if selinux is enabled, and it looks like yes?

Code: Select all

[root@lisl-ngos-01-pv mrtg]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   permissive
Mode from config file:          permissive
Policy version:                 24
Policy from config file:        targeted
[root@lisl-ngos-01-pv mrtg]#
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Switch wizard adding everything except entry in mrtg.cfg

Post by sreinhardt »

OK, permissive is good at least it should be allowing everything, even items that would be denied if it was fully enforcing. Are you seeing any errors in the audit log around the time you run the wizard? No worries on the learning, everyone has to start there at some point!

Code: Select all

grep -R- 'mrtg' /var/log/audit/audit.log
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: Switch wizard adding everything except entry in mrtg.cfg

Post by snapon_admin »

Is 'grep -R-' a valid option? Never seen -R- and it didn't seem to like that option. I tried that command with grep -R and got the attached results.
You do not have the required permissions to view the files attached to this post.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Switch wizard adding everything except entry in mrtg.cfg

Post by slansing »

I am a bit curious, if you add another device via the wizard, say.. a windows box even, do you get valid bandwidth data back? Can you test a port failure scenario with this switch to see if Nagios properly picks that up? It sounds like this is mainly a bandwidth issue, just hoping that it is restricted to that and not something entirely different. Also, silly question, but you do know for a fact that there is traffic on those interfaces correct?
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: Switch wizard adding everything except entry in mrtg.cfg

Post by snapon_admin »

if you add another device via the wizard, say.. a windows box even, do you get valid bandwidth data back?
Yes, I just added a switch and got bandwidth data back within 5 minutes
Can you test a port failure scenario with this switch to see if Nagios properly picks that up?
Not really. These are our managed MPLS routers. Our carrier manages them, we only have read access to the routers, and there's really no ports we can shut down to test a failed port scenario.
Also, silly question, but you do know for a fact that there is traffic on those interfaces correct?
Yes, I can see traffic on the CLI for the router, just not in Nagios.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Switch wizard adding everything except entry in mrtg.cfg

Post by slansing »

Hmm, this should be fixed in 2012 r2.9, but changes would have to be made to the current mrtg configurations, in your original mrtg.cfg, does it have a line specifying something along the lines of:

Code: Select all

include: /etc/mrtg/mrtg.cfg.bkp
If the switch you added was assigned to a different MRTG.cfg file, the fastest way to resolve this would be to include that config file in the original mrtg.cfg file, so it reads both in.
Locked