- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2017 11:51 AM
Tried using simple python and curl programs to hit the xmlstats processor but it seems the response is always a HTML page. How do we get to the xml and downloadit.
import requests
r = requests.get('https://XXXXX.service-now.com/xmlstats', auth=('admin', 'XXXX'))
print(r.status_code)
print(r.headers['content-type'])
print(r.content)
//Response
200
text/html;charset=UTF-8
b'<!DOCTYPE html><html lang="en" class=" ltr " data-doctype="true" dir="ltr"><head><title>ServiceNow</title><meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"></meta><meta http-equiv="cache-control" content="public"></meta><meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"></meta><script>\n\twindow.NOW = window.NOW || {};\n\tvar g_loadTime = new Date();\n\tvar lastActivity = new Date();\n\tvar g_lang = \'en\';\n\tvar g_system_lang = \'en\';\n\tvar g_enhanced_activated = \'true\';\n\t var g_popup_timeout = parseInt(100);\n\tvar g_export_warn_threshold = parseInt(10000);\n\t var g_event_handler_ids = {};\n\tvar g_event_handlers = [];\n\tvar g_event_handlers_onLoad = [];\n\tvar g_event_handlers_onSubmit = [];\n\tvar g_event_handlers_onChange = [];\n\tvar g_event_handlers_onCellEdit = {};\n\tvar g_event_handlers_localCache = {};\n\tvar g_event_handlers_queryTracking = true;\n\tvar g_user_date_time_format = "yyyy-MM-dd HH:mm:ss";\n\tvar g_user_date_format = "yyyy-MM-dd";\n\tvar g_user_decimal_separator = ".";\n\tvar g_user_grouping_separator = ",";\n\tvar g_glide_list_separator = ", ";\n\tvar g_tz_offset = -28800000;\n\t var g_tz_user_offset = true;\n\tvar g_first_day_of_week = parseInt(1, 10);\n\tvar g_date_picker_first_day_of_week = parseInt(0, 10);\n\t var g_full_calendar_edit = true;\n\tvar g_submitted = false;\n\tvar g_max_table_length = 80;\n\tvar g_fontSizePreference = "";\n\tvar g_fontSize = "10pt";\n\t// use to be the sys_property glide.ui.js_error_notify, hard coded for PRB603998\n\tvar g_jsErrorNotify = "true";\n\tvar g_cancelPreviousTransaction = true;\n\tvar g_text_direction = "ltr";\n\tvar g_glide_list_filter_max_length = parseInt("0", 10);\n\tvar g_accessibility = false;\n\tvar g_accessibility_visual_patterns = false;\n\tvar g_detail_row = false;\n\twindow.g_load_functions = [];\n\twindow.g_render_functions = [];\n\twindow.g_late_load_functions = [];\n\t\n\t\n\tvar g_ck = \'1c133a06db178300c492712ebf9619bfe0d68e664cddbab027e780a795e250c806d605e4\';\n\t\n\n\t\n\tvar g_acWaitTime = parseInt(250);\n\t\n\n\tvar g_autoRequest = \'\';\n\twindow.NOW.dateFormat = {timeAgo: false, dateBoth: false};\n\twindow.NOW.shortDateFormat = false;\n\twindow.NOW.listTableWrap = true;\n\twindow.NOW.compact = false;\n \twindow.NOW.templateToggle = false;\n\twindow.NOW.tabbed = false;\n\twindow.NOW.permalink = true;\n\twindow.NOW.useSimpleStorage = true;\n\twindow.NOW.simpleStorageSynch = "95731121db130300c492712ebf96192e";\n\twindow.NOW.language = \'en\';\n\twindow.NOW.listOpenInAppTab = false;\n\twindow.NOW.floatingScrollbars = false;\n\t\n\twindow.NOW.user = {};\n\twindow.NOW.user.preferences = [];\n\twindow.NOW.user.roles = \'\';\n\twindow.NOW.user.allRoles = \'\';\n\twindow.NOW.user.userID = \'5136503cc611227c0183e96598c4f706\';\n\twindow.NOW.user.departmentID = \'221db0edc611228401760aec06c9d929\';\n\twindow.NOW.user.firstName = \'\';\n\twindow.NOW.user.lastName = \'Guest\';\n\twindow.NOW.user.name = \'guest\';\n window.NOW.batch_glide_ajax_requests = \'true\' === \'true\';\n window.NOW.batch_glide_ajax_requests_max_time_in_queue = ~~\'50\';\n window.NOW.batch_glide_ajax_disable_time = ~~\'1000\';\n\n\twindow.NOW.currency = {};\n window.NOW.currency.code = \'USD\';\n window.NOW.locale = {};\n\twindow.NOW.locale.code = \'en_US\';\n </script><script>(function() {\n\t\t g_render_functions.push(setGlideUser);\n\t\tfunction setGlideUser() {\n\t\t\tif (window.g_user || !window.GlideUser)\n\t\treturn;\n\n\t\twindow.g_user = new GlideUser(NOW.user.name,\n\t\t\t NOW.user.firstName,\n\t\t\t NOW.user.lastName,\n\t\t\t NOW.user.roles,\n\t\t\t NOW.user.userID,\n\t\t\t NOW.user.departmentID);\n\t\twindow.g_user.setRoles(NOW.user.allRoles, true);\n\t\t}\n\t})();</script><script>window.NOW.filter_globals = "[[\\"This fiscal month\\",
Can someone help to me to understand how this java processor works....
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2019 08:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-31-2017 03:13 PM
Hi Surendra,
According to this blog post...How can I see statistics (xmlstats.do & stats.do) for all my nodes? it appears you could leverage the functionality within an OOB ui page to retrieve the information in a downloadable format.
I hope this helps!
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2018 05:43 AM
Berny thanks dude.... I looked at the widget and Diagnostics UIpages ... I understand that .. But Can we download the xmlstats xml using basic authentication from any thrid party application .. like a python based one ..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2018 05:40 AM
Hi Surendra,
i'm not sure if you can download the xmlstats xml from outside of ServiceNow. I believe i once try it and it wasn't a simple task at all since it's generated on the fly. I do know you could externally access stats.do though 🙂
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2018 05:16 AM
Yeah, that's one more thing that got enlisted itself in 'Not possible Yet' list 🙂
Appreciate your effort on this though 🙂