The other day someone asked me to find a server that match with the Serial Number they passed me. There were only 10 servers, but anyway with CollectNode there is no reason to make the search manually.
in this case we are going to find a server with a specific serial number, so let’s see how to do it.
First off all, we create the list of servers:
# cat servers.txt
To get the serial number we can execute the CollectNode command --system. That gives basic information about servers. Click here to see the documentation about --system.
A basic execution will display all servers with the information required for all of them. The serial numbers are blurred for security reasons 😉
collectnode --file servers.txt --system
But in this case we want just to appear the server that matches the serial number. So we use the filter --where, that only displays the servers that accomplish the condition specify. Click here to see the documentation about --where
collectnode --file servers.txt --system --where='system contain SN'
In this case we are filtering the servers to only display the information for the ones that the output of the command --system contains the serial number specify.
And that’s all!!
I hope you have enjoyed the reading. 😉