No Node Left Behind

Zenoss Blog: No Node Left Behind

3 Posts tagged with the ubuntu tag

We have updated the artifacts available for testing for the Zenoss 2.5 "King Crab" beta.  There are now stack installers available for all Linuxes and OSX as well as .deb stack installers for Debian and Ubuntu.  Please refer to the  original beta announcement for testing instructions, the downloads are available at http://www.zenoss.com/beta/2.5/.  The VMware image is still not available, we plan on adding it to the beta as soon as it is ready.

 

Thanks,

Matt Ray

Zenoss Community Manager

http://farm1.static.flickr.com/35/108263152_8984db9f56_m.jpg

6,006 Views 0 Comments Permalink Tags: ubuntu, beta, beta-testing, debian, king-crab, 2.5

In a recent forum post, user ‘rmk’ came up with a Perl script to expose the software inventory through the SNMP hrSWInstalled OID for Debian and Ubuntu machines. User ‘zarxcky’ wrote up detailed instructions for deploying the solution and getting it to work with Ubuntu. Many thanks to these two for providing a very useful guide for the Zenoss community. Here is the write-up from ‘zarxcky’, the Perl script URL is listed at the end of the post.

How to make the hrSWInstalled OID working on Ubuntu
Credit to RMK for making this works!

 

Disclaimer:


This guide is intended to be used with hrswinstalled.pl to resolve hrSWInstalled OID on Ubuntu not revealing anything to Zenoss.

 

Prequisite Packages (Ubuntu .debs) to prepare for *snmp-perl:


Install this packages first before testing running the script.

 

apt-get install all software listed below before attempting to run the perl scripts:

 

- libnet-snmp-perl
- libyaml-perl
- libparse-debian-packages-perl
- libsnmp-info-perl

 

Place the hrswinstalled.pl within /etc/snmp/ folder.

 

Modify the snmpd.conf and add:

 

perl do "hrswinstalled.pl";

 

Note: if the "perl do" command not working when you try to snmpwalk the hrSWInstalled oid, this is because the SNMP agents (snmpd) are not perl-embedded enabled.

 

Since default snmpd Ubuntu package does not have embedded-perl support enabled (check using: net-snmp-config --configure-options), we need to rebuild back the Ubuntu snmpd (come from net-snmp) package with the --enable-embedded-perl option within the net-snmpfolder/debian/rules. Once we got the package, remove the original snmpd package installed and use the custom one that we just built.

 

Use the howtoforge reference below to rebuild debian packages under Ubuntu.

 

Note: after the ./configure step, check the net-snmp configuration summary, for example as shown below:

---------------------------------------------------------
Net-SNMP configuration summary:
---------------------------------------------------------

SNMP Versions Supported: 1 2c 3
Net-SNMP Version: 5.4.1
Building for: linux
Network transport support: Callback Unix TCP UDP
SNMPv3 Security Modules: usm
Agent MIB code: default_modules => snmpv3mibs mibII ucd_snmp notification notification-log-mib target agent_mibs agentx disman/event disman/schedule utilities host
Embedded Perl support: enabled
SNMP Perl modules: building -- embeddable
SNMP Python modules: disabled
Authentication support: MD5 SHA1
Encryption support: DES AES

---------------------------------------------------------

If we got "Embedded Perl support: enabled", then we know we on the right path to Nirvana ;o)

 

Continue with debuild command to build .deb packages (see Howtoforge link).

 

Listed .deb packages:

 

libsnmp15_5.4.1~dfsg-4ubuntu4.2_amd64.deb
libsnmp-python_5.4.1~dfsg-4ubuntu4.2_amd64.deb
libsnmp-base_5.4.1~dfsg-4ubuntu4.2_all.deb
snmp_5.4.1~dfsg-4ubuntu4.2_amd64.deb
libsnmp-dev_5.4.1~dfsg-4ubuntu4.2_amd64.deb
snmpd_5.4.1~dfsg-4ubuntu4.2_amd64.deb
libsnmp-perl_5.4.1~dfsg-4ubuntu4.2_amd64.deb
tkmib_5.4.1~dfsg-4ubuntu4.2_all.deb

 

Backup the /etc/snmp/snmpd.conf to a safe place

 

Install using dpkg -i for everything EXCEPT libsnmp-python & tkmib (since we not really need it)


Note: You might face dependencies problem especially with libsnmpd15 vs. apt-get. This is where the apt-get and/or dpkg kung-fu will be needed.

 

Double check for existence of --enable-embedded-perl parameter using "net-snmp-config --configure-options" command.

 

Configure the /etc/default/snmpd


Restore the snmpd.conf to /etc/snmp && restart snmpd.

 

Test by running:


snmpwalk -v 2c -c public hidro.logistics.com hrSWInstalled

 

You will start to see long lists of hrSWInstalled OID in actions, displaying and listing all software installed within any Ubuntu systems.

 

Example:

 

Before:


#snmpwalk -v 2c -c public hidro.logistics.com hrSWInstalled
HOST-RESOURCES-MIB::hrSWInstalled = No Such Object available on this agent at this OID

 

After:


#snmpwalk -v 2c -c hidro.logistics.com hrSWInstalled
HOST-RESOURCES-MIB::hrSWInstalledName.1 = STRING: "adduser 3.105ubuntu1/all (add and remove users and groups)"
HOST-RESOURCES-MIB::hrSWInstalledName.2 = STRING: "apache2 2.2.8-1ubuntu0.3/all (Next generation, scalable, extendable web serv
er)"
HOST-RESOURCES-MIB::hrSWInstalledName.3 = STRING: "apache2-mpm-worker 2.2.8-1ubuntu0.3/amd64 (High speed threaded model for Apa
che HTTPD)"
HOST-RESOURCES-MIB::hrSWInstalledName.4 = STRING: "apache2-utils 2.2.8-1ubuntu0.3/amd64 (utility programs for webservers)"
HOST-RESOURCES-MIB::hrSWInstalledName.5 = STRING: "apache2.2-common 2.2.8-1ubuntu0.3/amd64 (Next generation, scalable, extendab
le web server)"
HOST-RESOURCES-MIB::hrSWInstalledName.6 = STRING: "apparmor 2.1+1075-0ubuntu9.1/amd64 (User-space parser utility for AppArmor)"
HOST-RESOURCES-MIB::hrSWInstalledName.7 = STRING: "apparmor-utils 2.1+1075-0ubuntu9.1/amd64 (Utilities for controlling AppArmor
)"
HOST-RESOURCES-MIB::hrSWInstalledName.8 = STRING: "apt 0.7.9ubuntu17.1/amd64 (Advanced front-end for dpkg)"

 

.... and so on...

 

References:


SNMP Software Inventory for Debian and Ubuntu machines

http://www.net-snmp.org/wiki/index.php/Tut:Extending_snmpd_using_perl
http://pwet.fr/man/linux/formats/snmp/snmpd_conf
http://www.howtoforge.com/how-to-rebuild-the-squid-2.6-debian-package-with-support-for-x-forwarded-for-headers

 

The Perl script is available for downloading here: SNMP Software Inventory for Debian and Ubuntu machines

8,532 Views 6 Comments Permalink Tags: zenoss, community, ubuntu, snmp, tips, debian, tip-of-the-month

SFD-08

 

Zenoss is more than happy to announce our sponsorship of Software Freedom Day 2008! Zenoss is committed to supporting the open source community and to helping spread the adoption of open source software. We see first hand the positive impact our software has on businesses, government, and educational institutions around the world, and want to participate in the growth and evangelism of open source software like ours. As a sponsor of Software Freedom Day 2008 we hope to further expose software users and developers to the benefits of transparent, collaborative software development.

 

Zenoss Austin will be participating in local Software Freedom Day events sponsored by the Austin Linux Users Group and the Austin Ubuntu Team, please come out and join the fun!  For more details: http://austinlug.org/node/294

4,896 Views 0 Comments Permalink Tags: zenoss, linux, ubuntu, austin, software-freedom-day, user-groups