[null, {"document_url": "http://dbaharrison.blogspot.com/2014/01/labelling-targets-in-cloud-control-easy.html", "unformatted_src": "http://2.bp.blogspot.com/-hjn6M2022GU/UuuuFH6QYKI/AAAAAAAAAj4/1n5ZZsGfve0/s1600/variation-69470_640.jpg", "src": "http://2.bp.blogspot.com/-hjn6M2022GU/UuuuFH6QYKI/AAAAAAAAAj4/1n5ZZsGfve0/s1600/variation-69470_640.jpg", "formatted_filename": "variation", "rendered_width": 320, "rendered_height": 292}, null, {"document_url": "http://dbaharrison.blogspot.com/2014/01/labelling-targets-in-cloud-control-easy.html", "unformatted_src": "http://4.bp.blogspot.com/-yzYJxcJMJYw/Uuur4UMGUeI/AAAAAAAAAjs/8tfaFM6fybk/s1600/emcli.png", "src": "http://4.bp.blogspot.com/-yzYJxcJMJYw/Uuur4UMGUeI/AAAAAAAAAjs/8tfaFM6fybk/s1600/emcli.png", "formatted_filename": "emcli"}, null, null, null, null, null, null, null, null, null, null, null, null, null, {"document_url": "http://dbaharrison.blogspot.com/2014/01/labelling-targets-in-cloud-control-easy.html", "unformatted_src": "//lh6.googleusercontent.com/-Hus-qdFzFO8/AAAAAAAAAAI/AAAAAAAABH0/iieC4bjs6o4/s80-c/photo.jpg", "src": "http://lh6.googleusercontent.com/-Hus-qdFzFO8/AAAAAAAAAAI/AAAAAAAABH0/iieC4bjs6o4/s80-c/photo.jpg", "formatted_filename": "photo", "alt_text": "My photo", "rendered_width": 80, "rendered_height": 80}, null, null, null, null]

Labelling targets in cloud control - the easy way Inside our current cloud control system we have a large number of servers and these can be subdivided into a number of different environment types. We occasionally want do do reporting where we can differentiate between the different types of environment. Now this can easily be done with logical groups inside the system and to be honest I don't really know why i didn't do it that way, but i didn't. I opted to set the target properties of the host instead....

The process below shows how i did it and you could actually do something very similar to allocate targets to groups - the principle is the same.

So here goes - i basically want to say for a group of servers you are now a certain environment - here's how i did that:

First up i need to generate a list of servers which i want to apply this setting to - i drive this from a select statement against one of the sysman views (i picked the first one i found that had what i needed - there are probably about half a dozen with the same info). I select this in a certain format - one that i know i can use with emcli later on:

select target_name||':'||target_type||':'||'Line of Business'||':'||'EGC;'
from sysman.MGMT$OS_SUMMARY t

this generates data of the format

server1:host:Line of Business:EGC;
server2:host:Line of Business:EGC;

Where 'EGC' is the tag i want to give the servers. This is a complete list of all the servers in the system so i somehow (manually in this case) have to remove the ones i dont want.

This data i then paste directly into a file call /tmp/recs.lst

I then use emcli to 'upload' these details

# emcli login -username=username_here
Enter password :

Login successful

#emcli set_target_property_value -property_records="REC_FILE" -input_file="REC_FILE:/tmp/recs.lst"
Properties updated successfully

And that's it -done for all of the listed servers. We can now see this as a host property if we navigate to Host->target information we see EGC in the line of business field. More usefully i can now find this information in the sysman views to be used for generating reports - this SQL for instance shows me all the hosts with the 'EGC' line of business property.

You can even add your own property should you so wish using a similar technique.

emcli has an incredible wealth of options - pretty much anything you can do in the gui you can do + a lot of other things beside - more info here emcli

Posted by Dbaharrison at Friday, January 31, 2014 Slider Section