I have aproximately 100 switches that need to be renamed in zenoss and a csv file with the IP address and corresponding name. Is there a way to rename a device from the terminal so that I can knock up a quick script to parse the csv and rename the devices based on the IP address?
Indeed there is. There is a
I'm not 100% sure, but "renaming" devices is probably akin to "moving" them in the devices hierarchy. There are logs of examples here to get you started.
I came across this while looking for the same solution. I took lukecyca's advice and asked on #zenoss.
The answer is to use zendmd to execute some python, either interactively or write a script to do it.
The following script was suggested by "frooderino" on #zenoos:
The input file would look like:
I adapted it slightly to run from a variable rather than a file but it worked just great.
you can run it in the zendmd shell using: