Populate SNMP Sensor Return Data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 02:26 PM
Hello,
I want to update a custom field on my CI record by capturing the SNMP Sensor return data on Classifier "On Classification Script".
How do i get the SNMP probe sensor data into "On Classification Script"
Servicenow Wiki has this code, but this wasn't much help
var computerName = g_sensor.deviceGR.name; var processClassiferName = g_classification.name; current.name = processClassiferName + "999" + "@" + computerName;
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2024 06:53 AM
@varaprasad123 - You want to change the way your CI is classified? or your classification is works fine and you have your CI record created, now you want an additional custom field value to be populated?
Assuming you ask is later: you can extend the pattern associated with the classifier and write your custom logic with OID to fetch the data and populate the field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2024 08:31 AM
Hi @Aneesh-D , thanks for your reply. I do not have a pattern in place, we are using a Probe / Sensor.
And then I have Process classifier, So i want "On Classification script" to update the custom field on CI record with Sensor return data precisely name of CI that returning from Sensor.
Hope i'm clear?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 01:49 PM
Nevermind, I figured it out, since CI Classifier "On Classification Script" runs on table. We have access to Current. So that makes it easy to reach any field that we wanted to udpate.
And, We have access to Sensor return data as well in the " On Classification Script".
So, Sample syntax to update a custom field with sensor return device name is,
current.customfield_name = values.get('name'); and this did magic 🙂
Just incase, If anybody looking for a an answer.
Thanks though @Aneesh-D
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 02:29 PM
bro you should direct contact them by instagram through this link of website it also download reels and stories of instagram. click here