User Tools

Site Tools


m

Welcome to our JAVASCRIPT PAGE Section M


Management Instrumentation and Discovery (MID) Server - MID Servers

- Takeaway A Management Instrumentation and Discovery (MID) Server is a Windows Service (or UNIX Daemon) application written in Java. The key to the MID Server is that it runs on your local enterprise network, NOT in the cloud along with the ServiceNow instance. And since it does NOT accept any inbound requests to initiate communication, it does not require any firewall ports to be opened, and is therefore safer from a security standpoint. The MID Server initiates all communication with a ServiceNow instance, not the other way around. It connects to your ServiceNow Instance just like a user does, over a secure SSL channel with all traffic encrypted end-to-end at the application layer. Since it resides on your network, the MID Server can have access to the file system, can run Java code from custom JAR packages, and may communicate directly with other network entities using unencrypted protocols such as JDBC. The MID Server is used by other applications in the IT Operations Management suite. It enables communication and the movement of data between a ServiceNow instance and external (to ServiceNow) applications, data sources, and services. Guided Setup for MID Servers is available. See also

Document "ServiceNowMIDServers.docx ! \\

MID Server - Provides communication and moves data from other systems to ServiceNow IT Operations Management (ITOM) applications. - A JAVA application that runs on your enterprise network (or in the cloud) as a Windows Service.
- Used by the following ServiceNow Applications: Cloud Management Discovery Event Management Operational Intelligence Orchestration Service Mapping Import Sets Module (for certain types of imports)
- Communicates securely using 128 bit Transport Layer Security (TLS). - The mid server normally resides inside the corporate firewall, and always initiates communication with the ServiceNow Instance. This eliminates the need for higher-risk inbound access through the corporate firewall.
- MID Server capabilities include: AWS Azure Cloud Management JDBC PowerShell Resolve DNS REST SOAP SSH SNMP VMware WMI
- Invalidate - You can invalidate a MID Server you suspect has been compromised to prevent it from accessing automation credentials in the instance or executing outbound ECC probes. - Invalidating a MID Server forces it to clear its memory and restart. The MID Server generates a new keypair on restart.
- Validate - You must manually validate the MID Server after it is installed to enable it to execute automation tasks. Validation restricts access to automation credentials to trusted MID servers only.
- Upgrades - The MID Server checks with the instance periodically to see if an upgrade is necessary. If the MID Server detects that a new version is available for upgrade, it downloads the installer from install.service-now.com and runs the package automatically
- External Communications Channel (ECC) Queue

  1. MID Server ECC Queue
  2. Table: ecc_queue.
  3. Filter Navigator - ECC - Queue
  4. A connection point between an instance and the MID Server.

- Jobs that the MID Server needs to perform are saved in this queue until the MID Server is ready to handle them. - The MID Server subscribes to messages published by the Asynchronous Message Bus (AMB).
- MID Server Installation 1) Create a user in “sys_user” table and give it the “mid_server” role. The MID server will use this to connect to the instance. 2) Setup a Windows Server Host such as Windows Server 2012. 3) From the Windows Server Host, with Chrome, browse to the target Instance of ServiceNow and download the MID Server files from the Downloads module. 4) From the root (C:\) of the host, create a folder called “MIDServer”. Then create a subfolder called XXXMid1, and if you want another mid server, XXXMid2. 5) Copy the entire “agent” folder into each of your MID Server sub-folders. 6) Run the “INSTALLER” windows batch file. Enter Instance URL, MID Server username (from “sys_user” table), and password. 7) Click Test Connection 8) Give the MID Server a name. This name will show up in ServiceNow, in the instance itself. Click “Next”, “Next”, “Start MID Server”, “Exit”.

You can supposedly create a brand new Service Account and password in the installation dialog on the fly, but this didn't work for me.

I had to create a LOCAL, NON-ADMINISTRATOR user, and add to the User Rights Assignment “ Log on as a service”.

		To create a Local User account on a server

Open File Explorer. Right click This PC - Manage - Tools - Computer Management. Then open the user - Member Of: administrators - [Check Names] (Note: All the information you provide in the Installation UI goes into the config.xml file.) 9) Open the MID Server Record on the instance and click on the Validate hyperlink (UI Action).

  1. Be patient. This can take a couple of minutes.

10) Launch “Services” on the windows server. Navigate to “ServiceNow MID Server XXX” to validate that the Servers are present. - Information about connections and messages is tracked in the logs in the logs subfolder.


Maintenance (over time)

- After Discovery is running you may want to ask the following questions to improve your results:

  1. What software packages do you want to exclude from Discovery and from the CMDB?
  2. How can the performance of Discovery be improved?
  3. Do we have Unix devices that we want to discover that do not use the standard port (22)?
  4. Is the CMDB unnecessarily populated by multiple data sources?

Many To Many - MTOM - MTom

https://docs.servicenow.com/bundle/paris-platform-administration/page/administer/table-administration/task/t_CreateAManyToManyRelationship.html - A many-to-many relationship is represented in ServiceNow as a “Related List”. - Table: sys_m2m - It seems that there is no Application or Module for creating Many to Many relationships, but you can go to sys_m2m.list and there should be a List Banner Button at the top of the list for creating “New” items. - Once you create a new M2M relationship, it should be available to add to forms as a tab. Do this under Configure - Related Lists. The name in the list will be the name of the related table. So if you created a relationship between Business Units and Users, and you are adding this to the Business Units form, you will select the item labeled “Users”.

Meta Keywords Field / Catalog Search

- ServiceNow is very forgiving when it comes to the Meta field. It's supposed to be comma-delimited, but I tried space delimited and also newline delimited, and they all worked fine. - Any keyword size (2 characters or more) will work, for the Meta field. - On the Platform side, only the first 15 entries will be shown, with no indication that there are more which are NOT shown, so that can be confusing. On the Portal side, it looks like the max is 30. - Changing the meta keywords seems to take effect immediately after saving the catalog item; no explicit index rebuilding is necessary. - If the catalog search seems to not be working for some fields, it may have something to do with Other fields not related to the Meta field.


MID Server

- A MID Server must be Installed AND Validated before discovery may be run. Discovery requires a MID Server to perform the actual Discovery operations. - HTTPS (port 443) is used to communicate between the MID Server and other entities. - Placement - MID Servers should be in locations close to devices that they will be discovering. One per campus, for example. - Having multiple MIDs setup has the added benefit of redundancy (failover). - Additionally with multiple MIDs, load balancing can be utilized, in situations in which there are many devices to be discovered. - PowerShell must be enabled on the MID Server. (For what exactly?)


Misc -Miscellaneous

- The get the URL of the current instance (current instance URL), use the following;

	var instanceURI = gs.getProperty('glide.servlet.uri'); //Note that this system property will not appear under sys_properties.list. \\

- Controlling various “ESLINT” features.

https://developer.servicenow.com/blog.do?p=/post/ny-studio-features/  \\

- To turn off the annoying “Unexpected console statement” warnings that appear when you have the following lines of code:

/* eslint-disable no-console */

/* eslint-disable no-mixed-spaces-and-tabs */ Mixed spaces and tabs

console.log("X");
console.warn("Y"); \\

- To convert a string, even a string containing commas to a number so that you may add it to another number, use the following: var nYear = parseFloat(sYear.replace(/,/g, “”));

- Google Maps “Markers” - Existing: http://kml4earth.appspot.com/icons.html - Generate Custom: https://mapicons.mapsmarker.com/

- Script to stay on the same page in a UI Action: action.setRedirectURL(current);
- Website for generating a Short Unique ID:

Also known as a Tiny GUID / Tiny ID

https://shortunique.id/
- The message “Match not found, reset to original” means that the system tried to Save a record, but one of the reference values did not match one of the valid values for the reference field. So the system reset the field to its original value, which may or may not have been null. In other words, the target reference field record could not be found.
- Use below script at client side to show message on list view function clientInfoMessage(theMessage){ GlideUI.get().addOutputMessage( { msg: theMessage, type: “info”, id: 'hello_world_message' } ); }
- Usually it is much better to use console.log() however, then hit F12, then filter by your initials, or whatever you are expecting to see in the messages. In the Client Side UI Action for a List View, you can use g_list.getQuery() to get the very same query that the user filtered the list on, and then you can feed that to a GlideRecord object.

Mobile Applications - Mobile Apps - Mobile

- Takeaway - Beginning with Orlando, the ServiceNow mobile applications, ServiceNow Agent, Now Mobile, and Onboarding, are Native applications for iOS and Android (not web applications). Only a few devices are officially Tested devices.
- See Also ServiceNow Agent
- Beginning with Orlando, the ServiceNow mobile applications are Native applications for iOS and Android (not web applications).
- Tested Devices
- An Orlando App Engine licensing agreement is required.
- Developers can create mobile content for the ServiceNow mobile applications.
- The Applications are:

  1. ServiceNow Agent
    1. Edit Records
    2. Collaborate with Coworkers
    3. Publish Location
    4. Work Offline
  2. Now Mobile
    1. Submit Requests
    2. Submit Incidents
    3. Manage Tasks
    4. Access Company Content (Resources)
  3. Onboarding
    1. Complete To Do list.
    2. Ask Questions
    3. Enable / Disable Notifications

Modules

- In order to see a Module listed in the Filter Navigator, a user must have access to that module via role lists at the following two locations: System Definition - Application Menus - Roles System Definition - Modules - Visibility – Roles
- A module is “the functionality within an application menu such as opening a page in the content frame or a separate tab or window”.
- Although one module is automatically created when a table is created, it's common for there to be many modules for a single table.
- Typically there would be at least one module that includes a Form for creating new records, and multiple modules to List different subsets of records.
- It is a good practice to name your modules in a similar fashion as the ServiceNow baseline modules, such as those for “Incident”.
- To change the ordering of the modules within an Application in the Filter Navigator, you can click the Pencil Icon (“Edit Application”) by hovering your mouse over an Application in the Filter Navigator. Then in the Modules related list, you can change the order values. Also, you can clear out the order values, and then the modules will automatically be sorted in Alphabetical order.
- Some important module types include the following:

  1. Assessment

Links to an Assessment-Based Survey, which you specify in the Assessment reference field.
- Content Page

Displays the content page you select in the Content Page reference field. \\

- Documentation Link

Links to a documentation page and opens it in a new tab or window. \\

- Homepage

Displays the homepage you select in the Homepage reference field. \\

- List Filter

Displays an unpopulated list view for the table you select in the Table field.  This allows users to complete the filter without loading the list first. \\

- List of Records

Displays the list view for the table you select in the Table field. \\

- Map Page

Displays the Map Page you select in the Map Page reference field. \\

- New Record

Displays a form for creating a record in the table you select in the Table field. \\

- Run a Report

Runs the predefined report you select in the Report field. \\

- Script (from arguments)

Runs the script as defined in the Arguments field. \\

- Search Screen

Link that displays a blank form for searching records in the table. \\

- Separator

Creates a division between modules.  Optionally enter a Title field to add a section name that controls collapsing and expansion. \\

- Single Record

	Displays a form for a single record on the table. \\
- Timeline Page
	Displays the Timeline Page you select in the Timeline Page reference field. \\
- URL (from Arguments)
	Opens ANY URL, as defined in the arguments field.
	- For internal links, always use a relative link such as ./catalog_home.do?sysparam_view=catalog_default \\

- A module CAN be made to open in a new browser tab (and perhaps in a new window).

Multifactor Authentication - Multi-Factor Authentication – MFA

- From the Side Door (Login.do page)

- If your account is locked out, you will not be told. You will just see “Username or password invalid” (which is misleading, because you can be entering the correct username and password, but it's still not working because your account is locked).



- If you entered a correct username and password, you will then be taken to the MFA page. - On the MFA Screen, never enter a space between the 6 digits, even if your MFA app on your phone displays a space. - From the MFA screen, if you enter an incorrect 6 digit code, OR if you entered the code TOO EARLY or TOO LATE, you will get a message saying “Response is invalid”. Entering the code too early is very counter-intuitive, but it is very possible. You may need to type in your MFA code and then wait until the NEXT code appears in your MFA app before hitting the Log in button.



- If you enter a 6 digit code and you see ONLY the following message WITHOUT the red “Response is invalid message, that indicates that your account is LOCKED! There is no point in continuing to enter codes at this point. You will not be able to login. Again, this is counter-intuitive, because you are seeing LESS red on the screen, and one fewer error message, but this means that you are actually in a Worse situation.



- If a user needs to totally reset MFA in his phone app, that is he needs to add a new account in his MFA app, this can be achieved by setting “Validated” to “false” for his account on the “User Multi-factor Setup” screen. This will cause the QA code to be presented to the user upon successful entry of Username and Password.


Multi-Row Variable Sets - MRVS

- A Multi Row Variable set is used to capture catalog item variable data in a grid layout. - Limitations
https://community.servicenow.com/community?id=community_blog&sys_id=15d6c8811b328010a59033f2cd4bcbf9 g_service_catalog

  1. Returns the value of the specified field on the catalog item form when used in a client script on multi-row variable sets (MRVS).

- Prior to Quebec, there is really no supported way of passing data from a Catalog Item to a MRVS. That seems to have been done by design.

Map Pages

- Docs - https://docs.servicenow.com/en-US/bundle/tokyo-platform-user-interface/page/administer/navigation-and-ui/concept/c_MapPages.html - Set up Google Maps API - https://docs.servicenow.com/en-US/bundle/tokyo-platform-user-interface/page/administer/navigation-and-ui/task/t_CreateAMapPage.html - https://docs.servicenow.com/en-US/bundle/tokyo-platform-user-interface/page/administer/navigation-and-ui/reference/scripting-for-map-pages.html

- Tables cmn_location - Use of this feature requires installation of the Google Maps plugin. - Map pages display ServiceNow data graphically on a Google map page based on location data that you provide. - After creating the map pages, you can create modules to display the map pages. - You can configure different levels of location in a parent-child hierarchy. - Location Table - Latitude - The get_lat_long business rule automatically populates this field and the Longitude field described below when the form contains enough information, such as an address or city name and a postal code. This business rule uses the GoogleMapsHelper script include to create sys_geocoding_request records. A scheduled job called Process Geocoding Request runs every 10 minutes, and processes sys_geocoding_request records. Process Geocoding Request uses Google Map service to populate the latitude and longitude fields of the changed or created Company and Location records. - Longitude - API - You enable the geolocation feature using the entries from a Google Maps API for Business license (old method), or a Google Maps JavaScript API Key.

"Mainline" Certifications

- Certified System Administrator - Certified Application Developer - Current through Tokyo (Passed Tokyo “Delta” Exam)

"Micro" Certifications

- Agile and Test Management Implementation - Agile Development 2.0 and Test Management 2.0 Implementation - Application Portfolio Management (APM) Fundamentals - Automated Test Framework - Enterprise Onboarding and Transitions - Flow Designer - Human Resource (HR) Integrations - Integration Hub Fundamentals - Performance Analytics - Predictive Intelligence - Virtual Agent

https://www.servicenow.com/community/ https://www.servicenow.com/community/developer/ct-p/Developer https://www.servicenow.com/community/notificationfeed/page (Notification feed) (bell icon) https://www.servicenow.com/community/user/viewprofilepage/user-id/47283 (My profile)

- You can navigate, using the Platform UI, to the various portal objects, via the following tables:

              sp_portal
              sp_instance
              sp_rectangle_menu_item
              sp_page
              sp_container
              sp_row
              sp_column
              sp_instance
              sp_widget

More notes about how to get from a Service Portal page to something useful

- Problem: From a portal page, how do we locate the underlying database field, and any “variables” or UI components used to SET the value of that field? - To find the name of the specific field you care about… - Right click the field label and choose “inspect”. - In the HTML, look for a “name” or “id” field, such as “site_state”. - To find the object you care about, that is the larger object that contains the field you care about… - Find some unique or long text on the form. - Search for that text in double quotes in the sys_metadata table. - In the object you locate, look for Table and field references - Now that you found the table you think is the correct table… - In the Table, change the Label of the field, and confirm that the label changes on the portal page, to confirm that you have located the right object, table, and field.

m.txt · Last modified: 10/31/2023 14:15 by johnsonjohn