This post is more than 5 years old

22 Posts

136544

November 21st, 2011 20:00

custom query for dashboard

Hello,

I am trying to create a query that is derived from an existing query.  I have created a query that returns all resource pools with the name "like" ovdc-%

However, I would like to filter out the result set so that anything that ends with the string "recover" will not show up.  How would I do that?  is there a "not like" comparison that I can use?

November 22nd, 2011 07:00

Hello Frank,

if you have a String then you can also use stuff like != which means not like

if (to.get("monitoredHost/name") != null){

}

Here another more complex example:

alarmList = asvc.getAlarms (past,now);

topSvc = server.TopologyService;

alarmList.each

{if (it.createdTime > past){

try{

    to = topSvc.getObject(it.getTopologyObjectID())

    if  (to.get("topologyTypeName") != "FSMServiceLevelPolicy"){

Ihave a list of Alarms and check for each object in my list if the createdTime is biggere than a specific Date.

After that i do some other stuff and do a check which determine if the topologyTypeName is not like FSMServiceLevelPolicy.

Kind regards,

Jan

22 Posts

November 24th, 2011 01:00

Hi Jan,

Where do you put the scripts?  I was trying to create a query using the built-in GUI.  So I select a services from the list, click "+" button to add where or orderby conditions, and I would like to get all resource pools with the name that starts with "ovdc-" and ends with anything but "recovery".  So ovdc-mcd will be returned, but not ovdc-mcd-recovery.

November 24th, 2011 06:00

Hello Frank,

i was in another Part of Foglight. So here will these Scripts not work.

But you can use Regular Expressions. Choose "Where" and "not equals" then build your string should be something like "./*recovery".

This is just out of my Head, could be wrong. You can just type Regular Expression into the Foglight Help to get more Infomoration.

Kind regards,

Jan

No Events found!

Top