The Now Platform® Washington DC release is live. Watch now!
07-30-2020 11:53 PM
Hi Community,
I need to create a scheduled job that monitors the health of the instsance (for example the memory that is currently in use) and creates notification when certain threshold is reached.
As far as I know such info is accessible in xml format when loading the 'https://<INSTANCE_NAME>.service-now.com/xmlstats.do' endpoint.
Can you please suggest how can I call this endpoint in a script and get the values of specific fields ( for example
07-31-2020 12:00 AM
Hi,
please check below links
Regards
Ankur
08-02-2020 08:43 AM
Hope you are doing good.
Let me know if that answered your question.
If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
Regards
Ankur
03-29-2021 01:33 PM
Here is an example code snippet. I had a similar requirement to check the Available progress workers on the instance. From here you can index the variables you need. Alternatively, there is also an OOB script include called 'Diagnostics' that you can reference for some of the Node related data. (This Script Include is used to populate the System Diagnostics UI Page/Dashboard).
try{
var rm = new sn_ws.RESTMessageV2();
var endpoint = gs.getProperty('glide.servlet.uri') + "xmlstats.do";
rm.setEndpoint(endpoint);
rm.setHttpMethod('GET');
rm.setRequestHeader('content-type', 'application/json');
var response = rm.execute();
var responseObj = new XMLHelper(response.getBody()).toObject();
gs.print("response=" + response.getBody());
gs.print("errorMsg=" + response.getErrorMessage());
}
catch(err){
gs.print("err=" + err);
}