I have taken the nagios provided Network Switch/Router config wizard and modified it for our company slightly. I have added a field to update the description through the wizard as it seems easier to do it in the wizard than to go through CCM to do it every time. I changed some of the default values as well, ie community string, pulling the hostname automatically from the device and populating the hostname field with the device hostname rather than the ip address, warning and critical default values. All is working great.
I just wanted to see if possibly the official nagios wizard could see some improvements, such as the description field being added or hostname being pulled from the card.
This is just an example of how I populate my hostname using snmp, I am sure there is a better way, but I am not a programmer by any means. This is a little more specific to my company as I am striping the domain name off the end.
Code: Select all
$hostname = grab_array_var($inargs, "hostname", "");
$resultfile = exec("snmpget " .escapeshellcmd($address). " -c nagios13014 -v 2c -O q -O v .1.3.6.1.2.1.1.5.0");
$hostname = str_replace('.tbaytel.net','',$resultfile);
Code: Select all
<tr>
<td class="vt">
<label>' . _('Description:') . '</label>
</td>
<td>
<input type="text" size="20" name="alias" id="alias" value="' . htmlentities($alias) . '" class="form-control">
<div class="subtext">' . _("The alias/description you'd like for this switch or router.") . '</div>
</td>
</tr>