Uploading multiple MIB files

Marcel H_
Tera Guru

I'm not sure if this makes sense, but when uploading MIB files, is there a requirement to upload each MIB file to a single record under MID Server> SNMP MIBs? Can multiple MIB file attachments be made to a single record? It seems quite tedious to upload tons of individual MIB files.

Also wondering if there are already MIBs loaded in the background that aren't specifically visible, like many of the RFC MIBs available (e.g. RFC4639-DOCSIS-Cable-Device, RFC4265-VPN-TC, etc.)?

4 REPLIES 4

doug_schulze
ServiceNow Employee
ServiceNow Employee

Marcel,



yes thats true, its one mib per record.   Its not often you find yourself needing to load multiple mibs but I'll let the PM know about the unique requirement and see what can be done.. also, no hidden mibs in the system.. what you see in that record list is what is there!


kosevkonstantin
Tera Contributor

A late reply to this thread, but in case someone have the same struggle. MIBs should be placed 1 per record and if you need to put MIBs into the system which are thousands in can be really painful. I do a simple 'hack'. Upload a lot of MIBs in one dummy record and from there to redistribute the attached MIBs per single one via background script. 

function test() {

var gr = new GlideRecord("sys_attachment");
var gr1 = new GlideRecord("ecc_agent_mib");
gr.addQuery("table_sys_id","<sys_id of the record which holds the uploaded MIBs>");
gr.query();

while(gr.next()){
gs.print("Processing attachment:  " + gr.file_name);

gr1 = new GlideRecord("ecc_agent_mib");
gr1.initialize();
gr1.name = gr.file_name;
gr1.description = gr.file_name;
gr1.insert();

gs.print("Insert done for: " + gr1.name + " also having ID: " + gr1.sys_id);

gr.table_sys_id = gr1.sys_id;
gr.update();

gr1.active = true;
gr1.update();

}

}

* The script is throwing error saying that the record flag "active" is set to false, because there is no attachment. This happens because the attachment is uploaded after the creation and later in the script is set to "true". So disregard this. 

** Also keep in mind large number of files attached can slow down the process. It mainly affects the "uploading" phase. Thus I done it using chunks around 200 MIBs per upload iteration. 

BH10
Tera Contributor

Hello Folks,

I have created to idea for this, kindly vote.

Samuel O_Connel
Tera Contributor

I devised a solution for processing and creating mass MIB records using a catalog item and flow designer. The catalog item request asks for a version, source, and a zip file. The flow is triggered upon request submission and collects variable values for task creation. The task is used as a staging record to contain all the MIB attachments extracted by "Extract Zip Action" and then attached to the task. A subflow is then used to process all the attachments on the task record to create a mib record for each attachment if the MIB doesn't exist, followed by the mib attachment being moved from the task to the mib record. The process only takes a few minutes to create the 104 mib records from the provided zip. I hope this helps. 

SamuelO_Connel_0-1722983802227.png

SamuelO_Connel_2-1722983930467.png

SamuelO_Connel_3-1722983961776.png

SamuelO_Connel_8-1722984645996.png

 

 

 

SamuelO_Connel_5-1722984042359.png