Network Switch Wizard Question

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Network Switch Wizard Question

Post by bosecorp »

I would like to see if there is a way to include other checks as part of the network switch wizard, like port error.

I have downloaded a different plug in to check interface errors that works fine. but I want this type of check to be added automatically as part of the wizard, that way I don't have to add the services later by either doing It manually or bulk copy.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Network Switch Wizard Question

Post by Box293 »

You can modify the wizard yourself and add the code that creates the services.

Somwhere around line 959 there is something like this:

Code: Select all

 // monitor port status
if (array_key_exists("portstatus", $serviceargs)) {
Inside this if statement you could also add the code to create the service, it's not that complicated:

Code: Select all

$objs[] = array(
	"type" => OBJECTTYPE_SERVICE,
	"host_name" => $hostname,
	"service_description" => $portname . " XXX your custom service name",
	"use" => "xxxxx your custom template",
	"check_command" => "xxx your custom command and arguments"
	"_xiwizard" => $wizard_name,
	);
You'll need to refer to the existing code to see how all the arguments are input including accounting for the different SNMP versions.

The steps I've mentioned above assume that you want the extra service created if the port status option was checked in the wizard. If you wanted to be prompted for different options for your extra service then this is going to get a lot more complex.

This old guide I wrote may also help:
https://exchange.nagios.org/directory/D ... ds/details
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Re: Network Switch Wizard Question

Post by bosecorp »

Thanks, I will play around with that.

Please close the ticket
Locked