Discovery Of AS400 Mainframe devicesIssue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } There are no probes/sensors currently defined for an AS400 Mainframe in Discovery. The Following Article explains how to create a Classifier, MultiProbe and MultiSensor to do some basic Discovery of this device. Procedure 1. Create a UNIX CI Classifier (Name it AS400). a. Use The IBM Mainframe Default Table b. Make the classification criteria 'output' CONTAINS 'OS400' c. On the classification script, you can put in something like this to start with: current.os = "OS/400"; current.os_name = "OS/400"; current.short_description = output; d. Save 2. Make a multiprobe. Call it "AS400 - Identity" a. ECC queue topic = "MultiProbe" b. ECC queue name = "AS400 - Identity." c. Set as a MultiProbe and Save. 3. Make the first probe. Call it "AS400 - OS" a. ECC queue topic = "SSHCommand" b. ECC queue name = "uname -a" c. Check Used by Discovery d. In the related list "Included by MultiProbe" add the Probe that you created called "AS400 - Identity Probe". e. In the "MultiSensor Scripts" related list click New, and paste the following code: function(result, ciData, debug, sensor) { var output = result.output; if (output === null || gs.nil(output)) return; run(output, ciData, debug); function run(output, ciData, debug) { var ci_data = ciData.getData(); var uname = output; var unameParts = uname.split(/ /); var osName = unameParts[0]; var osHostname = unameParts[1] ? unameParts[1] : "unknown.host"; var osVersion = unameParts[2] ? unameParts[2] : ""; ci_data.os_name = osName; ci_data.os_version = osVersion; ci_data.output = output; // Don't bother with ssh hostname if we shouldn't trust the ssh name and DNS already has already populated it var trusted = JSUtil.toBoolean(gs.getProperty("glide.discovery.hostname.ssh_trusted", "false")); var haveNow = JSUtil.notNil(ci_data['name']); var haveNew = JSUtil.notNil(osHostname); if (!haveNew) return; if (!trusted && haveNow) return; var hn = new HostnameJS(); ci_data['name'] = hn.format(osHostname, JSUtil.notNil(ciData.ip_address)? ciData.ip_address:null); } } f.Make sure that it Reacts to Probe "AS400 - OS" and click Save or Update.5.Create a brand new MultiSensor called AS400 - Identity a. Make sure it Reacts to Probe: "AS400 - Identity b. Use the following Script:new DiscoveryIDSensor({type: "AS400 Identity"}); c. Save the MultiSensor d. Make sure the related list "Responds to Probes" has the "AS400 - OS" Probe you created earlier6. Ensure that you have an SSH Credential Configured for the AS400 Target Device.7. Make sure that a compatible default Unix Style Shell is configured for the user on the AS400 (supported Shells are [tcsh, ksh, csh, sh, and bash]) Applicable Versions All Additional Information Once you have confirmed that this works, you can add additional probes to the MultiProbe in the related list "Includes probes". Since AS400 has a UNIX shell you can use, you can make a Filesystem probe with simply "df -kP" and you can make an Active Processes probe with "ps -aef". In these extended probes, just ensure that they are Triggered by your AS400 classifier and that there are Sensors defined for each!For active processes, simply use this in the script for the sensor: new DiscoveryPsSensor({ type: "DiscoverySensor" }); For Filesystems, use this code in the script for the sensor: new DiscoverySensor({ fileSystems: {}, process: function(result) { if (gs.nil(result.output)) return; this.parseOutput(result.output); this.updateFileSystems(); }, updateFileSystems: function() { var fsList = []; for (var fs in this.fileSystems) { var fileSystem = {}; fileSystem.name = this.fileSystems[fs].name; fileSystem.capacity = this.fileSystems[fs].capacity; fileSystem.available_space = this.fileSystems[fs].available_space; fileSystem.mount_point = fs; fsList.push(fileSystem); } this.addToRelatedList('cmdb_ci_file_system', fsList, 'provided_by', 'pid'); }, parseOutput: function(output) { var lines = output.split(/\n/); for (var i = 0; i < lines.length; i++) { var line = lines<i>.trim(); // handle the case where one of our data lines was split because the name was too long... if (line.indexOf(' ') < 0) { if ((i + 1 < lines.length) && (lines[i + 1].charAt(0) == ' ')) { i++; line = line + ' ' + lines<i>.trim(); } } if (!line.startsWith('/dev/')) continue; var parts = line.split(/\s+/); this.fileSystems[parts[5]] = {}; this.fileSystems[parts[5]].name = parts[0]; this.fileSystems[parts[5]].capacity = Math.round(parseInt(parts[1]) / 1024); this.fileSystems[parts[5]].available_space = Math.round(parseInt(parts[3]) / 1024); } }, type: 'DiscoverySensor' }); Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } all Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } X