This post is more than 5 years old

174517

May 24th, 2010 22:00

Wildcards in rule conditions

I have several VMs which I know will never get VMware tools installed, so I want to remove them from the alarm. I managed to get the rule to work if I add "||(scope.get("name") == "LXACS001")" to the "VMW Virtual Machine VMware Tools" condition. However, I really don't want to setup 4 different conditions to the IF statement. Can somebody please tell me how I can use a wildcard (or perhaps there's a better way to do this)? I want something like: "||(scope.get("name") like "LXACS%")".
Thanks!!

57 Posts

June 14th, 2010 19:00

in your rule scope you could do the following:
VMWVirtualMachine where name ! like "LXACS%"
-Larry

June 8th, 2010 18:00

Other way around: I want to look at all VMs that _don't_ start with "LXACS". I know the LXACS servers will always fail, so I don't want them getting alarms.

57 Posts

June 8th, 2010 18:00

so you only want it to look at VMs that start with LXACS?
-LM

June 14th, 2010 19:00

Excellent! I didn't know to do it in the scope section. I would have figured that it would be in the Condition section. I discovered the Scoping Query Editor, so I'm sure that I will use that heavily. Thank you very much!

June 14th, 2010 19:00

Mind if I ask a follow-up question? What if the scope is on a different object? For example, the "VMW Virtual Machine Memory Swapping" rule has a scope of VMWVirtualMachineMemory. I have a VM that keeps triggering it due to not having VMware Tools (one of the VMs I mentioned above). I want to stop getting emails on those, so I want to add the same condition to the scope. If I change the scope of the rule from VMWVirtualMachineMemory to VMWVirtualMachine (like if I were to use the same scope as above), will the conditions/alarms break?

57 Posts

October 2nd, 2010 17:00

The same will work for VMWVirtualMachineMemory as it does for VMWVirtualMachine.
eg.. VMWVirtualMachineMemory where name ! like "LXACS%'
or you can be more specific like:
VMWVirtualMachineMemory where name != "LXACS-myVM"
That will tell it to exclude just LXACS-myVM.
-Larry

57 Posts

October 3rd, 2010 10:00

Just make sure to export the rules (backup the rules) now and then just in case.
You can do this via cmd line on the vFog server:
Open cmd prompt and cd intto the vfoglight\bin folder, then run the below command:
fglcmd -ussr foglight -pwd foglight -cmd util:configexport -f c:\rules.xml
Of course, change the user/password strings as needed. This create an xml file of the rules. It can be imported back in.
-Larry

57 Posts

October 3rd, 2010 10:00

mistake in command:
fglcmd -usr foglight -pwd foglight -cmd util:configexport -f c:\rules.xml

Top