Collecting CMDB information of Solaris and Linux systems

As mentioned in the previous post I am working on a tool which collects essential information of Linux and Solaris systems. The first release is finally public available on GitHub (collect_sysinfo.py).

Why have I written this tool? I needed it for my job and I found no other tool, which fulfilled our requirements. Additionally it was a nice opportunity to train my Python and RegEx skills.

Interestingly, collecting the information was also sometimes a challenge, because sometimes you need different methods or tools on Intel and Sparc Solaris platforms and even on global and non-global zones on the same platform. And of course there is also a difference between Linux and Solaris.

Most likely documenting basic information from Unix servers is needed by a lot of people, I don’t know why in 2012 there is no single stable interface for infos like CPU cores, server model, etc.

The output is plain CSV, so it can be post-processed and/or imported easily into a CMDB.

hostname;manufacturer;hardware_model;chassis_sn;os_name;is_virtual;memory;cpu_model;cpu_speed;cpu_count;cpu_cores;vcpu_count;oracle_core_sum;release_info;virtual_servers;ilo_address;network_info
zone1;Sun Microsystems;Sun SPARC Enterprise M5000 Server;;Solaris;True;10.00;SPARC64-VII;2400;6;24;48;;Oracle Solaris 10 9/10 s10_u9wos_14a;;;bge0 192.168.0.201 255.255.255.0 empty empty
zone2;Sun Microsystems;Sun SPARC Enterprise M5000 Server;;Solaris;True;10.00;SPARC64-VII;2400;6;24;48;;Oracle Solaris 10 9/10 s10_u9wos_14a;;;bge0 192.168.0.200 255.255.255.0 empty empty
solarisg1;Sun Microsystems;Sun SPARC Enterprise M5000 Server;BGSD0000;Solaris;False;256.00;SPARC64-VII;2400;8;32;64;24.0;Oracle Solaris 10 9/10 s10_u9wos_14a;zone1,zone2;192.168.0.10;bge0 192.168.0.100 255.255.255.0 00:55:55:55:55:55 ipmp1,bge2 192.168.0.101 255.255.255.0 00:55:55:55:55:56 ipmp1

Maybe the tool is also helpful for somebody else.

Source: collect_sysinfo.py

Share Comments