|
From: Ryan M. <rm...@hy...> - 2007-03-14 16:45:01
|
It's possible to enable/disable metrics in batch using the HQ shell. If you have a complete list of resources which you'd like to continue collecting metrics for, you can do this programmatically. For example:
ryan-morgans-computer:~/hyperic/hq_ee/build/shell rmorgan$ ./hq-shell.sh
hq-shell::not-logged-in> login hqadmin:hqadmin@localhost
Successfully logged in as hqadmin at localhost:2099
hq-shell::hqadmin> resource list -service > services.txt
This will put every service in your inventory into a file called services.txt. You can then filter this list so that it only includes the services you would like to disable. For example, if you want to disable all services but your CPU's and NIC's:
cat services.txt | grep -v -i cpu | grep -v -i network > disable.txt
You can then use that list of services to generate a set of commands when can then be sourced through the HQ shell.
cat disable.txt | grep ^[0-10].* | awk '{print "metric disable -service " $1}' > shellcmds.txt
The shellcmds.txt should then have output that looks like:
metric disable -service 10015
metric disable -service 10039
metric disable -service 10036
...
To disable the metrics for those services, you can then log back into the shell and run the script using the source command.
Hope this helps,
-Ryan
|