Script Include MidServer check logic -please assist
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 06:33 AM - edited 10-22-2024 06:35 AM
Hello Community Experts,
Need your expertise help here please. We have a code in Script include where it takes Mid SErver name and checks if this is validated or not. This is all working okay.
Now the situation is we have created a MidServer Cluster - as Loadbalance and added 2 mid servers in them .
Now it does not take Midserver cluster name i think because table name is different.
How to update this then so that it checks both Midservers under the cluster name are validated. Tried changing but not working
The system property holds the mid server name and is passed here. Now i want MidServer Cluster name in that property
This is existing script snippet.
Thanks
if (this.mid_server) { this.logMessage('Lookup MID server:' + this.mid_server); gr = new GlideRecord('ecc_agent'); //gr = new GlideRecord('ecc_agent_cluster'); // gr = new GlideRecord('ecc_agent_cluster_member_m2m'); // gr.addQuery('agent', this.mid_server); gr.addQuery('name', this.mid_server); gr.query(); if (gr.next()) { this.logMessage('Lookup for MID server "' + this.mid_server + '" succeeded'); } else { this.logMessage('MID Server "' + this.mid_server + '" is not in the list of available MID Servers'); throw "MID Server Not Defined"; } if (gr.validated != 'true') { this.logMessage('MID Server "' + this.mid_server + '" has not been validated', "error"); throw "MID Server Not Validated"; } } |