This post is more than 5 years old
23 Posts
0
140327
September 17th, 2012 23:00
vFoglight Rule Not Firing
I have created a rule to monitor several VM's and alert if they ever move from their designated hosts. When I put the condition script in the 'Run Condition Query' it runs the code successfully and returns 'true' or 'false' however the rule is not generating an alarm. I have forced the rule to return 'true' as shown below and have verified that the rule is active. Any help would be great
The script takes the name of the VM and splits the name where 'vgw' was and then puts the name back together with 'esx' in the name. It uses this name to compare against the name of the esxServer/name, if they are different then the script would return true and fire off an alarm. (for the test I set the script to return true if the esxServer name matches the string I created)
example: mynamevgw001 --> mynameesx001
vm = scope.get('name')
esxhost = scope.get('esxServer/name')
myarray = vm.split('vgw')
mystring = 'esx'
esxhostcompare = myarray[0] + mystring + myarray[1]
if (esxhost == esxhostcompare)
return true;
Thanks

