ZMIRROR - Illegal Value
I am trying to work on a ZMIRROR that will execute a shell script to failover our VIP at the hardware level when NotifyBecomePrimary occurs.
ZMIRROR ; Custom logic for specific mirroring events
q
;
NotifyBecomePrimary() PUBLIC {
#;This procedure is called as a notification when this system becomes Primary.
#;It does not return any value.
#; invoke the command to select this host for running the crontab
try {
Set cmd = "/usr/local/sbin/failover-intengtest-vip_SR"
d $ZF(-100,"/SHELL /LOGCMD /STDOUT=/archive/logs/failover-intengtest-vip.log""",cmd)
}
catch e {
d ##class(%SYS.System).WriteToConsoleLog("NotifyBecomePrimary^ZMIRROR error: "_e.AsSystemError(),,1)
}
q
}
ObjectScriptObjectScript
I verified the $ZF syntax by creating a smaller script and executing it via terminal. However when ZMIRROR is executed when I am attempting to failover I am getting the following in messages.log
01/13/24-14:47:47:812 (4104771) 1 [Utility.Event] NotifyBecomePrimary^ZMIRROR error: <ILLEGAL VALUE>NotifyBecomePrimary+3^ZMIRROR
Can anyone see what the Illegal Value might be?
Product version: IRIS 2022.1
$ZV: IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2022.1 (Build 209U) Tue May 31 2022 12:13:24 EDT
The double-double quotes after .log?
d $ZF(-100,"/SHELL /LOGCMD /STDOUT=/archive/logs/failover-intengtest-vip.log""",cmd)
I think I tried that but I. Previous testing via terminal I had to put the multiple “” to get it to actively write the output to a log file. I will give it a try again later.
Try also the opposite -- adding quotes before the filename
d $ZF(-100,"/SHELL /LOGCMD /STDOUT=""/archive/logs/failover-intengtest-vip.log""",cmd)
There was a mismatch of quotes.