Hi,

question is here how is that global being populated/created? Is this global defined by usage of a class inheriting from %Persistent?

If so, a fast way would be to be using %Extent to enumerate all instances and then look at the rowcount.

e.g.

set query = ##class(%SQL.Statement).%New()
set qStatus = query.%PrepareClassQuery("User.Person","Extent")
set rset=query.%Execute()
d rset.%Display()
zw %ROWCOUNT

So just looking at your SQL,. You got 2 parameters in your where clause.

Select IDName from MSDS_Common.ComponentSub

 Where 

    (is null or %UPPER(Component)[%UPPER(?))

    and Active=1

If the first dropdown is null this will always be true if Active is 1

Try changing the where clause to

 Where 

    (is null AND ( %UPPER(Component)[%UPPER(?))

    and Active=1

This will check if first parameter is empty and if subcomponent contains the second parameter and if its active.

as an alternative you could use to standard traceroute 

 traceroute -n -T -m 5 -q 1 -p 80 hostname.local

-p portnumber

-T use TCP syn for connects

-m max TTL to test

If it succeeds it will return all IPs if the IP is not reachable it will only report *.
If the port is blocked it will return somethink like

 1  192.168.1.198  0.411 ms !X

Where !X means admin prohibited.

Hi,

if you make some assumptions

1. numbers are always enclosed in curved brackets

2. you want to always return string starting with REASON

this could be as easy as just:

set mystring="REASON->Blood(1.23)"

w "REASON"_$extract(mystring,$find(mystring,"(")-1,*)

or if you really want to use regex:

IRISHEALTH:USER>set mystring="REASON->Blood(1.23)"
IRISHEALTH:USER>set regex=##class(%Regex.Matcher).%New("^([A-Z]*)->.*(\([0-9]*.[0-9]*\))",mystring)
IRISHEALTH:USER>zw regex.Locate()                                               1
IRISHEALTH:USER>zw regex.Group(1)
"REASON"
 IRISHEALTH:USER>zw regex.Group(2)
"(1.23)"

The entrypoints of ZMIRROR are called during the mirror failover process. E.g. if the backup mirror has successfully taken over all roles and now has become primary the relevant entrypoint (not sure but something like HasBecomePrimary^ZMIRROR) is being called. So code added to that entrypoint will be executed at that time .

ZMIRROR cannot be used for monitoring purposes only to execute actions during a failover process.

This is NOT correct a VIP is not needed for a failover mirror even with ASYNC DR.

Any Async Mirror will know of all mirror nodes and try both failover mirror members if it cannot connect to the primary automatically. For this it uses the superserver IP configured on the mirror setup or the private mirror IP if it is able to access it. 

A VIP is only needed for application that are not mirror aware.

Even the current web/csp gateway can be configured to be mirror aware.