logo

NJP

Custom Probe and Sensor to get Serial Number for Juniper SRX 100

Import · Jun 11, 2018 · article

Custom Probe and Sensor to get Serial Number for Juniper SRX 100

  • We were not getting Serial Number for this model Juniper SRX 100 Router on CMDB form i.e on CI Record. But we were getting Model Number and Manufacturer for this model.

Steps to be followed in writing Probe and Sensor for a Router(SNMP) to get Serial Number:

  1. Write a SNMP MIB for this model. Go to SNMP MIB’s and create new MIB for this Router
  2. (SNMP MIB: The SNMP MIB Files component contains the Management Information Base (MIB) files for the Simple Network Management Protocol (SNMP). A MIB is a collection of formally described objects. Each object represents a particular type of information)
  3. Get the SNMP MIB File from Internet or from Vendor who is asking us to get the information on CMDB table.
  4. Get MIB files for Juniper model from below link

https://apps.juniper.net/mib-explorer/search.jsp#object=jnxBoxAnatomy&product=Junos%20OS&release=17....

image

image

  • Version : Get the details from the MIB File from internet given the link.
  • Source: Give the Link details from where you are downloading the MIB File.
  • Download the file from Internet and save it as .txt on your desktop and Attach the MIB File to the SNMP MIB and don’t save it with any extension.
  • Define OID for this Router Juniper SRX 100
  • (Snmp oid: In computer networking, an OID, in the context of the Simple Network Management Protocol (SNMP), consists of the object identifier for an object in a Management Information Base (MIB).)
  • Get the SNMP OID for this particular model Router from Internet. Create a OID for this model in ServiceNow.
  • SNMP OID – New – Give the table name in which the data to be stored – Classifier as what it has to classify.
  • In our case, we are using this Juniper SRX 100 as “Routers” so we gave the table as “IP Router” and Classifier as “Standard Network Router”

image

  • After defining MIB and OID, start writing Probe and Sensor for this model to get Serial Number.

PROBE:

  1. Class – To which class this belongs to. In our case, we are using Juniper as “Router” so it comes to class SNMP.
  2. ECC Queue topic is SNMP and ECC Queue Name is same name given in Name field.
  3. In SNMP Fields – Give the OID path for the Serial Number for Juniper SRX 100 model.(we can get it from Internet) and Command as “Walk”.

image

image

SENSOR:

  1. Create a Sensor for the Probe.
  2. Class : Sensor and Sensor type: Java script
  3. In Script: Write the code to get the serial number for this model.

new DiscoverySensor( {

process: function(result) {

var snmp = new SNMPResponse(result);

var oid_serial = snmp.getOIDText('iso.org.dod.internet.private.enterprises.juniperMIB.jnxMibs.jnxBoxAnatomy.jnxBoxSerialNo');

gs.log('oid_serial' +oid_serial); // Can check in System Logs

current.serial_number = oid_serial;

},

type: 'DiscoverySensor'

});

image

View original source

https://www.servicenow.com/community/itom-articles/custom-probe-and-sensor-to-get-serial-number-for-juniper-srx-100/ta-p/2317839