Switch&Router / NCPA wizards - interface name and direction

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
solarmon
Posts: 81
Joined: Fri Sep 13, 2019 3:57 am

Re: Switch&Router / NCPA wizards - interface name and direct

Post by solarmon »

Hi @ssax

Thanks for the update and clarification. I wasn't sure whether you were a developer - but you have clarified your position and the scope of this thread.

Thank you making the feature requrest on my behalf - I wasn't sure of the process for that.

I'm happy to make any changes required to get this feature working and fully accept that this has to be done manually until the feature is released officially.

Please let me know what I need to do to get this feature working.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Switch&Router / NCPA wizards - interface name and direct

Post by ssax »

Please replace the file below with the one's I've attached:

Code: Select all

/usr/bin/cfgmaker
/usr/local/nagiosxi/html/includes/configwizards/switch/switch.inc.php
Then run through the Switch Wizard again, selecting Alias on the first page under Monitor Using.

Let us know the results.
You do not have the required permissions to view the files attached to this post.
solarmon
Posts: 81
Joined: Fri Sep 13, 2019 3:57 am

Re: Switch&Router / NCPA wizards - interface name and direct

Post by solarmon »

@ssax

Thank you!

I have replaced those files (making backup of originals) and can confirm that I am able to use the wizard to create the interfaces of Windows hosts using the interface Alias name.

Note, I had to make the follow tweaks.

Set ownership:

cfgmaker (root.root)
switch.inc.php (nagios.nagios)

Set permissions:

Code: Select all

chmod a+x cfgmaker
I notice that the permissions of the original cfgmaker has a "." at the end of it:

(using ls -Z)

Code: Select all

-rwxr-xr-x  root root ?                                cfgmaker
-rwxr-xr-x. root root system_u:object_r:bin_t:s0       cfgmaker.orig
I don't know how to set this "system_u:object_r:bin_t:s0" permission but the wizard seems to be working OK once I set the executable permission for it.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Switch&Router / NCPA wizards - interface name and direct

Post by ssax »

That period means there are possible SELinux permissions applied.

See here:

https://serverfault.com/a/304529

What is the output of these commands:

Code: Select all

sestatus
getenforce
solarmon
Posts: 81
Joined: Fri Sep 13, 2019 3:57 am

Re: Switch&Router / NCPA wizards - interface name and direct

Post by solarmon »

We normally disable SELinux:

Code: Select all

# sestatus
SELinux status:                 disabled

# getenforce
Disabled
So I'm not too worried about this particular issue, considering it is all working as expected. Just wanted to understand what it meant, so thank you for the link.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Switch&Router / NCPA wizards - interface name and direct

Post by ssax »

No problem, glad to help! Is that going to work for you (the switch wizard updates)?
solarmon
Posts: 81
Joined: Fri Sep 13, 2019 3:57 am

Re: Switch&Router / NCPA wizards - interface name and direct

Post by solarmon »

@ssax

Yes, I am happy with the wizard update and the manual update process. I hope this feature will be added officially.

The only reason why I'm using this switch/script wizard is because the NCPA agent does not combine the inbound and outbound performance stats. But the NCPA method allows us to create service templates. However, with the switch/script wizard actually creates the configs for MRTG and then creates a service that points to it - so it cannot be templated.

Ultimately, I would like the NCPA script/agent to support combining the interface inbound/outbound performance stats.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Switch&Router / NCPA wizards - interface name and direct

Post by ssax »

I think removing the /bytes_recv should do it for NCPA unless I'm missing something:

Code: Select all

[root@xid libexec]# /usr/local/nagios/libexec/check_ncpa.py -H X.X.X.X -t 'xxxxx' -P 5693 -M 'interface/MyActualAdapterName' -d -u M -w 10 -c 100
OK: Bytes_sent was 0 MB/s (Dropin: 0 packets/s, Bytes_recv: 0 MB/s, Packets_recv: 0 packets/s, Dropout: 0 packets/s, Errout: 0 errors/s, Errin: 0 errors/s, Packets_sent: 0 packets/s) | 'bytes_sent'=0;10;100; 'dropin'=0;10;100; 'bytes_recv'=0;10;100; 'packets_recv'=0;10;100; 'dropout'=0;10;100; 'errout'=0;10;100; 'errin'=0;10;100; 'packets_sent'=0;10;100;
VS:

Code: Select all

[root@xid libexec]# /usr/local/nagios/libexec/check_ncpa.py -H X.X.X.X -t 'xxxxx' -P 5693 -M 'interface/MyActualAdapterName/bytes_recv' -d -u M -w 10 -c 100
OK: Bytes_recv was 0 MB/s | 'bytes_recv'=0;10;100;
Note the output differences, adjust the thresholds as needed.
solarmon
Posts: 81
Joined: Fri Sep 13, 2019 3:57 am

Re: Switch&Router / NCPA wizards - interface name and direct

Post by solarmon »

@ssax

Thank you for testing the check_ncpa.py script.

However, this is fine if you manually create a service check, but the problem is that the NCPA wizard itself automatically creates the separate service checks.

There is no option is the NCPA wizard to combine inbound and outbound traffic.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Switch&Router / NCPA wizards - interface name and direct

Post by ssax »

Ah, good point!

Code: Select all

FR: XI - NCPA Wizard - Interfaces - Add the ability to use combined inbound/outbound instead of having separate Inbound/Outbound services
Locked