Page 1 of 1

Network Switch Wizard Question

Posted: Wed Nov 04, 2015 2:54 pm
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.

Re: Network Switch Wizard Question

Posted: Wed Nov 04, 2015 10:27 pm
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

Re: Network Switch Wizard Question

Posted: Thu Nov 05, 2015 8:21 am
by bosecorp
Thanks, I will play around with that.

Please close the ticket