We have many service dashboards created in Spectrum, I need to validate some servers whether they are part of any of the Services or not, how can we do that from server model?
One way I know go to each service model and search verify if the concerned servers are part of any service model or not, which is really time consuming.
I want to know from server model itself, like from any attribute that would indicate if concerned servers are part of any Service model?
Release : 20.2
Component : Spectrum Applications
You can search either via CLI (Command Line Interface) or RESTfull Web Services.
Here are the steps:
1. Take note of the model_handle attribute value of the server/device in question.
2. Go to the SpectroSERVER host.
3. Open a bash shell (bash -login) logged as Spectrum Install Owner account.
4. Connect to CLI:
$ ./connect
5. Run the following syntax to find if a server/device belongs to a Service:
$ ./show associations mh=<model_handle of the server> | grep SlmMonitors
Here are some examples:
$ ./show associations mh=0x1000fb | grep SlmMonitors
LMHandle LMName Relation RMHandle RMName
0x100117 Service1 SlmMonitors 0x1000fb Server_123
Where 0x100117 is the model_handle of the Service
$ show associations mh=0x10008b | grep SlmMonitors
LMHandle LMName Relation RMHandle RMName
0x100119 Service1_Resource_mon SlmMonitors 0x10008b Server_456
Where 0x100119 is the model_handle of the Service
6. Disconnect from CLI:
$ ./disconnect
7. Paste the following URL in a regular browser (RESTful WebService API):
http://<OneClick_hostname>:<port>/spectrum/restful/associations/relation/0x4500004/model/0x1000fb?side=right
Where 0x1000fb is the model_handle of the server.
You will get an output like below:
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
-<association-response-list xmlns="http://www.ca.com/spectrum/restful/schema/response">
-<association-responses>
<association rightmh="0x1000fb" leftmh="0x100117" rh="0x4500004"/>
</association-responses>
</association-response-list>
Where 0x100117 is the model_handle of the Service.
http://<OneClick_hostname>:<port>/spectrum/restful/associations/relation/0x4500004/model/0x10008b?side=right
Where 0x10008b is the model_handle of the server.
You will get an output like below:
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
-<association-response-list xmlns="http://www.ca.com/spectrum/restful/schema/response">
-<association-responses>
<association rightmh="0x10008b" leftmh="0x100119" rh="0x4500004"/>
</association-responses>
</association-response-list>
Where 0x100119 is the model_handle of the Service.
$ ./show relations | grep SlmMonitors
Name RelationID Type
SlmMonitors 0x04500004 MANY_TO_MANY