- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2022 06:03 PM
Hello experts,
Through other community answers, we are advised that there is no table to query data from for stats.do and servicenow performance dashboard. But is there a possible script which can fetch this data specially for data displayed for memory.
We would like to be able to catch data that our instance is having high memory utilization if possible and be able to send us a notification when a certain memory is utilized before our instance throw an OOM error. Is this possible via scripts
Thanks in advance
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2022 06:30 PM
Hi,
You can use this example to get the ball rolling:
var diag = new Diagnostics();
while (diag.nextNode()) {
var diagNode = diag.getNode();
var nodeName = diagNode.name;
var memUse = diagNode.stats['system.memory.in.use'];
var memFree = diagNode.stats['system.memory.pct.free'];
gs.info("Node name: " + nodeName + " Memory in use: " + memUse + " Memory % Free: " + memFree);
}
You can also refer to the UI Page: system_diagnostic_page for more information.
Then sort of take it from here.
The above is just an example to get you started.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 05:40 PM
Hello, thanks for the reply,
Yes I think your answer was really much closer to what I was wondering for. Thanks again.
What I would just like to verify is if the the system_diagnostic_page in UI pages and the script include Diagnostics are the one that is also used by stats.do to display the its data right?
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2022 06:36 PM
Hello,
Just an additional question, is the UI page: system_diagnostic_page that is used in this script the same page that is displayed in stats.do?
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 03:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 05:43 PM
Hello,
How were you able to display all those values in widgets? I am still fairly new to servicenow so I am still not that very well versed on manipulating the artifacts.
Thanks.