Monday, September 15, 2008

Wireless LAN in Linux

Wireless LAN in Linux

Wireless support in Linux can be pretty shrewd to say the least. Most wireless vendors base their cards on cheap chip sets that have no support for Linux. This can lead to a lot of hassle. However there is a solution.

Ndiswrapper is a utility for Linux that allows you to use Windows wireless drivers on your Linux system. I've used it several times on different computers and had it working perfectly.

Distribution Notes

Ubuntu: Instead of running commands as root, use sudo before each command (e.g. sudo modprobe ndiswrapper)

Caution

This tutorial was written using Kubuntu Feisty (7.04) I do not guarantee that it will work. Some things in this tutorial may be specific to Kubuntu. If you find yourself unable to do something in this tutorial e-mail me and I shall try and fix it.

Native Drivers

Before trying Ndiswrapper, it's recommended you have a browse around Google to find native drivers for your card since these will probably work better than Ndiswrapper. If you don't know your device chipset run lspci or lsusb (Depending on what type it is) and it should tell you. If you've come up empty handed or the native driver is a bit iffy, continue.

Getting Ndiswrapper

First of all we need to get Ndiswrapper, we can either compile from source or get a distribution specific package. I recommend finding a distribution specific package rather than compiling from source as it's more likely to work.

From The Internet

If you have internet access through another device run these commands in console.

Debian users (As root):
 
Code:
apt-get install ndiswrapper-common ndiswrapper-utils-1.9
Ubuntu users:
 
Code:
sudo apt-get install ndiswrapper-common ndiswrapper-utils-1.9
Fedora Core users (As root):
 
Code:
yum install kmod-ndiswrapper
Suse users (As root):
 
Code:
yast2 -i ndiswrapper
Offline Install

If you don't have internet access (or if you don't know how to get packages from the repository) you'll need to get packages from somewhere else and transfer them onto your Linux box. Here are a few places you can get packages from:

RPM based distributions (Suse, Fedora Core, Mandrivia):
RPM Search
(Search for ndiswrapper for your distribution)

Debian based distributions (Debian, Ubuntu):
Debian -- Packages
Ubuntu packages
(Search for ndiswrapper-common and ndiswrapper-utils-1.9

From Source

If you can't be arsed with all that, you may like to compile from source, a source tarball can be found at the Ndiswrapper Website. It's recommended you use a stable release, not a testing release.

Move to the directory where the tarball is located:
 
Code:
cd /path/to/directory
Now take everything out of the archive:
 
Code:
tar -zxvf ndiswrapper-1.44.tar.gz
Now run the following commands as root and Ndiswrapper should be installed.
 
Code:
make
make install
You're likely to encounter problems here if you don't have GCC installed and all the necessary compile files (Kernel source/headers).

Wrapping The Drivers

If you completed the last section successfully then you should be able to run 'ndiswrapper' in console and get some output without errors. That being the case, lets move on.

Which one?

Just a brief explanation, the driver for the wireless card will be a .inf file; sometimes there are additional files the .inf file needs to install such as .sys files. Keep these files with the .inf file otherwise you won't be able to use it.

Lets Go!

First of all, find the drivers, either on a CD or someone on your hard drive, then run this command as root.
 
Code:
ndiswrapper -i /path/to/driver.inf
Note that if the driver fails to install you need to remove the broken files; use the following command to list drivers installed:
 
Code:
ndiswrapper -l
And use this command to remove the driver (as root):
 
Code:
ndiswrapper -e driver_name
If all that's worked, run 'ndiswrapper -l' and you should see something like this:
 
Code:
graham@lightside:~$ ndiswrapper -l
bcmwl5 : driver installed
        device (14E4:4320) present (alternate driver: bcm43xx)
If you don't see 'device (code) present' then the .inf file doesn't support the card. Also if you see 'alternate driver' you'll need to disable it (assuming it didn't work) read the 'Problems' section at the end for help.

Loading the Module

Now, we're almost sorted. We need to load the module, to do this run the following (As root):

modprobe ndiswrapper

If you don't see anything errors, then it worked! Your card should be active.

Device name

This is important, after this run dmesg to find the device name of the card (Default wlan0) without that you won't be able to setup the card. Also you can use iwconfig (described below) to list wireless devices, like so.
 
Code:
graham@lightside:~$ iwconfig
lo        no wireless extensions.

eth0      IEEE 802.11b  ESSID:"13cliff"
          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:0D:54:9C:D9:CC
          Bit Rate=11 Mb/s   Tx-Power:14 dBm
          RTS thr=2347 B   Fragment thr=2346 B
          Power Management:off
          Link Quality:78/100  Signal level:-46 dBm  Noise level:-96 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
Obviously yours won't yet have an ESSID and key and such.

Connecting

Assuming the driver works (Check for lights) then all we need to do is connect to the access point. You can use GUI tools like KNetworkManager to set-up the connection, this is recommended if you're likely to connect to more than one access point. However I'm going to show you IWconfig, IWconfig is part of Wireless Tools for Linux and will let us connect to the access point by running these commands (As root):
 
Code:
iwconfig <device name> essid <essid of ap>
iwconfig <device name> key s:”<key>”
So something like:
 
Code:
iwconfig eth0 essid 13cliff
iwconfig eth0 key s:“myaccesspoint”
Finally, we start DHCP. There are several ways of starting DHCP with different commands, try all of these until you get one that works (As root):
 
Code:
dhclient <device name>
dhcpcd <device name>
And that should be it. Enjoy your new connection!

Problems

Alternative Driver

If you have an alternative driver for the card (that isn't functioning) you need to blacklist it. To do that, open a text editor and edit '/etc/modprobe.d/blacklist' with any non-formatting text editor (kwrite, gedit, nano) (As root):
 
Code:
nano /etc/modprobe.d/blacklist
Add this to the bottom of the file:
 
Code:
# driver blacklisted and replaced by ndiswrapper
blacklist <drivername>
E.G.:
 
Code:
blacklist bcm43xx
Once that's done, save the file and run the following command to unload the module (As root).
 
Code:
modprobe -r <drivername>
E.G.:
 
Code:
modprobe -r bcm43xx
And load Ndiswrapper again (As root):
 
Code:
modprobe ndiswrapper

Thursday, May 15, 2008

Workload Partitioning (WPAR) in AIX 6.1

The most popular innovation of IBM® AIX® Version 6.1 is clearly workload partitioning (WPARs). Once you get past the marketing hype, you'll need to determine the value that WPARs can provide in your environment. What can WPARs do that Logical Partitions (LPARs) could not? How and when should you use WPARs? Equally as important, when should you not use Workload Partitioning. Finally, how do you create, configure, and administer workload partitions? These topics will all be discussed in this article.

Introduction

WPARs are a bold new innovation, implemented within AIX 6.1. It allows administrators to virtualize their operating system, which allows for fewer operating system images on your IBM System p™ partitioned server. Prior to WPARs, you would need to create a new Logical Partition (LPAR) for each new "isolated" environment. This is no longer necessary (with AIX 6.1 only), as there are many circumstances when one can get along fine with multiple WPARs within one LPAR. Why is this important? Every LPAR requires its own operating system image and a certain number of physical resources. While you can virtualize many of these resources, there are still some physical resources that must be allocated to the system. Furthermore, you need to install patches and technology upgrades to each LPAR. Each LPAR requires its own archiving strategy and DR strategy. It also takes some time to create an LPAR; you also need to do this outside of AIX, through a Hardware Management Console (HMC) or the Integrated Virtualization Manager (IVM).

WPARs are much simpler to manage and can actually be created from the AIX command line or through SMIT. LPARs cannot. By far the biggest disadvantage of LPARs is maintaining multiple images, which goes along with possibly over-committing expensive hardware resources, such as CPU and RAM. In other words, while partitioning helps you consolidate and virtualize hardware within a single box, operating system virtualization through WPAR technology goes one step further and allows for an even more granular approach of resource management. It does this by sharing OS images and is clearly the most efficient use of CPU, RAM, and I/O resources.

Rather than a replacement for LPARs, WPARs are a complement to them and allow one to further virtualize application workloads through operating system virtualization. WPARs allow for new applications to be deployed much more quickly, which is an important side-benefit. On the other side of the coin, it's important to understands the limitations of WPARs. For example, each LPAR is a single point of failure for all WPARs that are created within the LPAR. In the event of an LPAR problem (or a scheduled system outage, for that matter), all underlying WPARs will also be affected.




 

WPARs: How and when to use them

This section further defines the different types of workload partitions and discusses scenarios where WPARs should be used.

As discussed earlier, Workload Partitions (WPARs) are virtualized operating system environments that are created within a single AIX (only supported on AIX 6.1) image. While they may be self-contained in the sense that each WPAR has its own private execution environment with its own filesystems and network addresses, they still run inside the global environment. The global environment -- the actual LPAR -- owns all the physical resources of the logical partition. It is important to also note that the global environment can see all the processes running inside the specific WPARs.

There are two types of WPARs: system workload partitions and application workload partitions. The system WPAR is much closer to a complete version of AIX. The system WPAR has its own dedicated, completely writable filesystems along with its own inetd and cron. Application WPARs are real, lightweight versions of virtualized OS environments. They are extremely limited and can only run application processes, not system daemons such as inetd or cron. One cannot even define remote access to this environment. These are only temporarily objects; they actually disintegrate when the final process of the application partition ends, and as such, are more geared to execute processes than entire applications. Overall, WPARs have no real dependency on hardware and can even be used on POWER4 systems that do not support IBM's PowerVM (formerly known as APV). For AIX administrators, the huge advantage of WPARs is the flexibility of creating new environments without having to create and manage new AIX partitions. Let's look at some scenarios that call for the use of WPARs.

Application/workload isolation

WPARs are tailor-made for working with test and/or QA and development environments. Most larger organizations have at least three environments for their applications. These include development, test, and production. Some environments have as many as five, including demo/training and stress/integration environments. Let's use an example of a common three-tier application environment: Web, application server, and database server. In the land of the LPARs, in an environment where one has five isolated environments, you would need to create 15 LPARs. This is where the WPAR has the most value. In this environment, we would need to create just five LPARs. How is that?

In Table 1, we have five different environments, consisting of a Web server, an application server, and a database server. If we wanted to isolate our environments, the only way to do this would be through logical partitioning. That would involve architecting 15 logical partitions. Of course, we could run some of our Web, application, and database on one LPAR, but if we did that, how would we be able to really mimic our production environments (which would run on separate partitions)? In today's world of 99.9% availability, it is extremely common to give each application environment its own home. With WPARs, we can now do that, without having separate AIX images.


Table 1. Web portal -- LPARs only
 
Development (3 lpars) Demo/Training (3 lpars) Test (3 lpars) Pre-Prod (3 lpars) Production (3 lpars)
1.Dweb01 4.Trweb01 7.Tstweb01 10.Ppweb-01 13.Pweb01
2.Dapp01 5.Trapp01 8.Tstweb01 11.Ppapp01 14.Papp01
3.Dora01 6.Traora01 9.Tstora01 12.Ppora01 15.Pora01

Table 2 illustrates how that is done. Each environment would have its own LPAR, with three WPARs created within each LPAR. Now let's imagine if we had four Web servers, two application servers, and two database servers supporting this environment. Yikes! AIX administrators supporting Fortune 500 companies know what I'm talking about. It can be a nightmare maintaining all these environments. WPARs dramatically simplify the overall work-effort involved in administrating this environment, while at the same time minimizing the expense of having to assign physical resources to logical partitions.


Table 2. Web portal -- WPARs inside of LPARs
 
Development
1 LPAR, 3 WPARs
Demo/Training
1 LPAR, 3 WPARs
Test
1 LPAR, 3 WPARs
Pre-Prod
1 LPAR, 3 WPARs
Production
1 LPAR, 3 WPARs
Dwparweb01 2.Trwparweb01 3.Tstwparweb01 4.Ppweb-01 5.Pweb01
1. Dwaparapp01 2.Trwpapp01 3.Tstwparapp01 4.Ppapp01 5.Papp01
1. Dwparora01 2.Trwparora01 3.Tstwparora01 4.Ppwparora01 5.Pora01

Playing nicely in the sandbox

In virtually every environment I've managed, my staff has begged to have sandbox environments in which to work. These environments would be used only by the systems administrators. It is here that administrators have the opportunity to install new software, test out new patches, install new technology levels, and generally be free to break the system without any effect to the business. Unfortunately, it is always the sandbox that is the first environment that must be given up when a new application needs to be deployed. With WPARs, you can quickly create an isolated environment in which to play. While my preference is to have several WPAR sandboxes within an overall LPAR sandbox, each of these owned by a different administrator, this now becomes less of a luxury than it used to be. Looking at this from another perspective, these WPARs are the training ground for new administrators to learn and practice their craft on. With WPARs, they can now be managed much more efficiently and created without having to assign dedicated devices to them.

Quickly testing an application

The application WPAR can be created in just a few seconds. What better way is there to quickly troubleshoot an application or wayward process? As these are temporary resources, they are destroyed as soon as they end, simplifying the manageability of these partitions.



 

WPARS: When not to use them

This section discusses situations and scenarios where you may not want to use WPARs.

Security

As stated previously, WPAR processes can be seen by the global environment from the central LPAR. If you are running a highly secure type of system, this may be a problem for you from a security standpoint. Further, the root administrator of your LPAR will now have access to your workload partition, possibly compromising the security that the application may require.

Performance

Each WPAR within LPAR is now using the same system resources of the LPAR. You need to be that much more careful when architecting your system and also when stress testing the system. For example, if you're running a performance benchmark on your pre-production system after a new build has been deployed and there are some developers working on the application server while you are testing your database, this will all be done within one LPAR sharing the same resources. Your teams will all need to understand that there will be competing resources now for the same product.

Availability

If you are in an environment where it is very difficult to bring a system down, it's important to note that when performing maintenance on an LPAR that every WPAR defined will be affected. At the same time, if there is a system panic and AIX crashes, every WPAR has now been brought down. From this standpoint, LPARs without WPARs can provide increased availability across your environment, albeit at a cost that may be prohibitive.

Production

I'm extremely conservative when it comes to production. I like to run each tier in production within its own logical partition. I do this because I like the granularity and complete OS isolation that LPARs provide, without having multiple environments (Web, applicatoin, and database) to worry about.

Physical devices

Physical devices are not supported within a WPAR. While there is a way to export devices, this can be a big problem for applications that require non-exportable devices. In this case, they would be restricted to only running in the global environment. For example, Oracle RAC is not supported using Solaris zones because of this limitation, and should not work in a WPAR environment for the very same reason.


 

Creating, configuring, and administering WPARs

This section creates, configures, and administers WPARs, both system and application.

System WPARs

The mkwpar command creates the WPAR, installs the filesystems, and prepares the system (see Listing 1). It also synchronizes the root section of the installed software.


Listing 1. The mkwpar command
 
                
lpar5ml162f_pub[/] > mkwpar -n devpayrollWPAR01
mkwpar: Creating file systems...
 /
 /home
 /opt
 /proc
 /tmp
 /usr
 /var

<< End of Success Section >>

FILESET STATISTICS
------------------
  241  Selected to be installed, of which:
      241  Passed pre-installation verification
  ----
  241  Total to be installed

+-----------------------------------------------------------------------------+
                         Installing Software...
+-----------------------------------------------------------------------------+


Filesets processed:  6 of 241  (Total time:  2 secs).

installp:  APPLYING software for:
        X11.base.smt 6.1.0.1
Filesets processed:  7 of 241  (Total time:  3 secs).
installp:  APPLYING software for:
        X11.help.EN_US.Dt.helpinfo 6.1.0.0
Filesets processed:  8 of 241  (Total time:  3 secs).
installp:  APPLYING software for:
        bos.acct 6.1.0.1
Filesets processed:  9 of 241  (Total time:  3 secs).
installp:  APPLYING software for:
        bos.acct 6.1.0.2
Filesets processed:  10 of 241  (Total time:  4 secs).
installp:  APPLYING software for:
        bos.adt.base 6.1.0.0
        bos.adt.insttools 6.1.0.0
Filesets processed:  12 of 241  (Total time:  4 secs).
installp:  APPLYING software for:
        bos.compat.links 6.1.0.0
        bos.compat.net 6.1.0.0
        bos.compat.termcap 6.1.0.0

Workload partition devpayrollWPAR01 created successfully.
mkwpar: 0960-390 To start the workload partition, execute the 
following as root: startwpar [-v] devpayrollWPAR01

 

Depending on the type of system you are using, this generally takes between two and four minutes. It took me two minutes and 40 seconds, installing 241 filesets on a one-CPU POWER5 processor running at 1654 MHz. To check the status of the WPAR, use the lswpar command (see Listing 2).


Listing 2. Use the lswpar command to check the status of the WPAR
 
                
lpar5ml162f_pub[/] > lswpar
Name              State  Type  Hostname          Directory
-------------------------------------------------------------------------
MyTestWpar1       A      S     MyTestWpar1       /wpars/MyTestWpar1
MyTestWpar2       A      S     MyTestWpar2       /wpars/MyTestWpar2
devpayrollWPAR01  D      S     devpayrollWPAR01  /wpars/devpayrollWPAR01

 

In this case, it is still in what is called the "defined state." We'll need to use the startwpar command to make it active (see Listing 3).


Listing 3. Using the startwpar command
 
                
lpar5ml162f_pub[/] > startwpar -v devpayrollWPAR01
Starting workload partition devpayrollWPAR01.
Mounting all workload partition file systems.
Mounting /wpars/devpayrollWPAR01
Mounting /wpars/devpayrollWPAR01/home
Mounting /wpars/devpayrollWPAR01/opt
Mounting /wpars/devpayrollWPAR01/proc
Mounting /wpars/devpayrollWPAR01/tmp
Mounting /wpars/devpayrollWPAR01/usr
Mounting /wpars/devpayrollWPAR01/var
Loading workload partition.
$corral_t = {
              'name' => 'devpayrollWPAR01',
              'wlm_cpu' => [
                             undef,
                             undef,
                             undef,
                             undef
                           ],
              'path' => '/wpars/devpayrollWPAR01',
              'hostname' => 'devpayrollWPAR01',
              'wlm_procVirtMem' => [
                                     -1,
                                     undef
                                   ],
              'wlm_mem' => [
                             undef,
                             undef,
                             undef,
                             undef
                           ],
              'key' => 3,
              'vips' => [],
              'wlm_rset' => undef,
              'opts' => 4,
              'id' => 0
            };
Exporting workload partition devices.
Starting workload partition subsystem cor_devpayrollWPAR01.
0513-059 The cor_devpayrollWPAR01 Subsystem has been started. Subsystem PID is 753708.
Verifying workload partition startup.
Return Status = SUCCESS.
lpar5ml162f_pub[/] >

 

You can now see that is it is in an active state (see Listing 4)


Listing 4. The WPAR is in an active state
 
                
lpar5ml162f_pub[/] > lswpar
Name              State  Type  Hostname          Directory
-------------------------------------------------------------------------
MyTestWpar1       A      S     MyTestWpar1       /wpars/MyTestWpar1
MyTestWpar2       A      S     MyTestWpar2       /wpars/MyTestWpar2
devpayrollWPAR01  A      S     devpayrollWPAR01  /wpars/devpayrollWPAR01

To login, we'll use the clogin command and our hostname for the WPAR. 

Let's login: lpar5ml162f_pub[/] > clogin devpayrollWPAR01
*******************************************************************************
*                                                                             *
*                                                                             *
*  Welcome to AIX Version 6.1!                                                *
*                                                                             *
*                                                                             *
*  Please see the README file in /usr/lpp/bos for information pertinent to    *
*  this release of the AIX Operating System.                                  *
*                                                                             *
*                                                                             *
*******************************************************************************

 

Let's run some standard AIX commands (see Listing 5).


Listing 5. Some standard AIX commands
 
                
# hostname
devpayrollWPAR01
# w
  10:59AM   up 13 mins,  1 user,  load average: 0.00, 0.00, 0.00
User     tty          login@       idle      JCPU      PCPU what
root     Global      10:59AM          1         0         0 -
# whoami
root
# ps -ef
     UID    PID   PPID   C    STIME    TTY  TIME CMD
    root 258064 573578   0 10:47:42      -  0:00 /usr/sbin/sshd
    root 340006 573578   0 10:47:55      -  0:00 /usr/sbin/rsct/bin/IBM.Servic
    root 356468 573578   0 10:47:56      -  0:00 /usr/sbin/rsct/bin/IBM.AuditR
    root 421948 573578   0 10:47:41      -  0:00 /usr/sbin/rpc.lockd -d 0
    root 471122      1   0 10:47:23      -  0:00 /usr/lib/errdemon
    root 504032 573578   0 10:47:42      -  0:00 /usr/dt/bin/dtlogin
    root 508124 643204  28 11:00:15      ?  0:00 ps -ef
    root 512114 573578   0 10:47:39      -  0:00 /usr/sbin/portmap
    root 561344 573578   0 10:47:56      -  0:00 /usr/sbin/rsct/bin/IBM.CSMAge
    root 573578      1   0 10:47:33      -  0:02 /usr/sbin/srcmstr
    root 602286      1   0 10:47:41      -  0:00 /usr/sbin/cron
    root 606358 573578   0 10:47:41      -  0:00 /usr/sbin/qdaemon
    root 630928      1   0 10:59:02      ?  0:00 clogin devpayrollWPAR01
    root 635076 573578   0 10:47:39      -  0:00 sendmail: accepting connectio
    root 643204 630928   0 10:59:02      ?  0:00 -ksh
    root 651276 573578   0 10:47:39      -  0:00 /usr/sbin/biod 6
    root 655560 573578   0 10:47:41      -  0:00 /usr/sbin/writesrv
    root 737494 573578   0 10:47:54      -  0:00 /usr/sbin/rsct/bin/rmcd -a IB
    root 741406 573578   0 10:47:39      -  0:00 /usr/sbin/inetd
    root 749714 573578   0 10:47:38      -  0:00 /usr/sbin/syslogd
    root      1      0   0 10:47:21      -  0:00 /etc/init
#

 

Your systems administrator can start and stop processes from the WPAR using the SRC or from the command line, just as they would from the global environment. As the Global (LPAR) system administrator, you will note that a WPAR has lots of filesystems. The WPAR environment is created under /wpars (see Listing 6).


Listing 6. Creating the WPAR environment under /wpars
 
                
lpar5ml162f_pub[/wpars/devpayrollWPAR01/wpars] > hostname
lpar5ml162f_pub
# df -k
Filesystem    1024-blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4           131072     19472   86%     8278    62% /
/dev/hd2          3538944    150480   96%    91842    70% /usr
/dev/hd9var        262144    246796    6%      522     1% /var
/dev/hd3           262144    259540    1%       56     1% /tmp
/dev/hd1           131072    130688    1%        8     1% /home
/dev/hd11admin      131072    130708    1%        5     1% /admin
/proc                   -         -    -         -     -  /proc
/dev/hd10opt       262144    119804   55%     3048    11% /opt
/dev/fslv12        131072    103476   22%     2244     9% /wpars/devpayrollWPAR01/ora01
/dev/fslv13        131072    128660    2%        5     1% /wpars/devpayrollWPAR01/home
/opt               262144    119804   55%     3048    11% /wpars/devpayrollWPAR01/opt
/proc                   -         -    -         -     -  /wpars/devpayrollWPAR01/proc
/dev/fslv14        131072    128424    3%        9     1% /wpars/devpayrollWPAR01/tmp
/usr              3538944    150480   96%    91842    70% /wpars/devpayrollWPAR01/usr
/dev/fslv15        131072    116448   12%      370     2% /wpars/devpayrollWPAR01/var

Here is the view from the WPAR

# hostname
devpayrollWPAR01
# df -k
Filesystem    1024-blocks      Free %Used    Iused %Iused Mounted on
/dev/fslv12        131072    103476   22%     2244     9% /
/dev/fslv13        131072    128660    2%        5     1% /home
/opt               262144    119804   55%     3048    11% /opt
/proc                   -         -    -         -     -  /proc
/dev/fslv14        131072    128424    3%        9     1% /tmp
/usr              3538944    150480   96%    91842    70% /usr
/dev/fslv15        131072    116448   12%      370     2% /var

 

Creating filesystems

Let's turn our attention back to the global environment. Let's create a filesystem through SMIT. You cannot create a f/s or volume group from the WPAR, only from the global environment (LPAR).

We need to make sure that the full path of the filesystem (including the WPAR path) is specified (see Figure 1).


Figure 1. The full path of the filesystem is specific in SMIT
The full path of the filesystem is specific in SMIT
 

Figure 2 shows the the file system has been created successfully.


Figure 2. The file system has been created successfully
The file system has been created successfully
 

After it's successfully created, you'll need to make one minor change to the filesystem: the mount group needs to be explicitly defined (see Figure 3). Note that this step is not necessary when using the command line to create the filesystem: # smit chjfs2.


Figure 3. Explicitly defining the mount group
Explicitly defining the mount group
 

Now let's turn back to the WPAR, where you'll create the mountpoint and mount the newly created filesystem (see Listing 7).


Listing 7. Creating the mountpoint and mounting the filesystem
 
                
# mkdir ora
# pwd
/
# mount ora /ora01
# df -k
Filesystem    1024-blocks      Free %Used    Iused %Iused Mounted on
/dev/fslv12        131072    103444   22%     2246     9% /
/dev/fslv13        131072    128660    2%        5     1% /home
/opt               262144    119804   55%     3048    11% /opt
/proc                   -         -    -         -     -  /proc
/dev/fslv14        131072    128424    3%        9     1% /tmp
/usr              3538944    150480   96%    91842    70% /usr
/dev/fslv15        131072    116448   12%      370     2% /var
/ora               131072    103444   22%     2246     9% /ora01
#

 

Note that you also cannot increase the size of a filesystem from the WPAR, only from the global environment. You also cannot serve NFS filesystems from within the WPAR; only NFS clients are supported.

Backups

Remember, there are no physical devices in a WPAR. When backing up the WPAR environment, you need to use the savewpar command, again from the global environment.


Listing 8. Using the savewpar command
 
                
lpar5ml162f_pub[/wpars/devpayrollWPAR01/wpars] > savewpar 
                   -f /admin/payroll.backup devpayrollWPAR01

Creating information file for workload partition devpayrollWPAR01.

Creating list of files to back up.
Backing up 2829 files
2829 of 2829 files (100%)
0512-038 savewpar: Backup Completed Successfully.
lpar5ml162f_pub[/wpars/devpayrollWPAR01/wpars] >

 

You can restore using the restwpar command.

Users and groups

You can maintain users and groups within the WPAR, either from the command line or through SMIT. You should understand that the root user for this environment does not have access to the global environment, only to the WPAR (see LIsting 9).


Listing 9. Maintaining users and groups within the WPAR
 
                
# mkuser test
# mkgroup testing
# hostname
devpayrollWPAR01
# lsuser
Usage: lsuser [-R load_module] [ -c | -f ] [ -a attr attr ... ] 
                                    { "ALL" | user1,user2 ... }
# lsuser test
test id=204 pgrp=staff groups=staff home=/home/test shell=/usr/bin/ksh 
login=true su=true rlogin=true daemon=true admin=false sugroups=ALL admgroups= 
tpath=nosak ttys=ALL expires=0 auth1=SYSTEM auth2=NONE umask=22 registry=files 
SYSTEM=compat logintimes= loginretries=0 pwdwarntime=0 account_locked=false 
minage=0 maxage=0 maxexpired=-1 minalpha=0 minother=0 mindiff=0 maxrepeats=8 minlen=0 
histexpire=0 histsize=0 pwdchecks= dictionlist= default_roles= fsize=2097151 cpu=-1 
data=262144 stack=65536 core=2097151 rss=65536 nofiles=2000 roles=
# lsgroup testing
testing id=203 admin=false users= registry=files
#

 

Now let's turn our attention back to the global environment. You can clearly see in Listing 10 that the user was not created in the global environment, only within that specific WPAR.


Listing 10. The user was not created in the global environment
 
                
lpar5ml162f_pub[/wpars/devpayrollWPAR01/wpars] > lsuser test
3004-687 User "test" does not exist.
lpar5ml162f_pub[/wpars/devpayrollWPAR01/wpars] >

 

WPAR manager

It's worth noting that there is a graphical tool called WPAR manager, which is Java™ based and allows for the centralized management of WPARs (see Figure 4).


Figure 4. WPAR manager
WPAR Manager
 

While a thorough review of this utility is outside the scope of this article, it's definitely worth looking at because using it will increase your ability to manage the overall environment. It will also help you harness innovations such as Workload Partition Manager and WPAR Mobility. Workload Partition Manager allows for resource optimization, allowing you to distribute workloads more efficiently throughout your managed system. WPAR mobility allows you to move running partitions from one frame to another, which increase availability of workloads during scheduled outages.

Application WPARs

To reiterate, an application WPAR is defined as a WPAR that allows an application and/or a process to run inside of it, similar to a wrapper. It is only temporary, not a permanent object, and it will end when the application and/or process ends. To create one, use the wparexec command.


Listing 11. Using the wparexec command to create an application WPAR
 
                
lpar5ml162f_pub[/wpars/devpayrollWPAR01/wpars] > wparexec -n templs1 /usr/bin/ls
Starting workload partition templs1.
Mounting all workload partition file systems.
Loading workload partition.
devpayrollWPAR01
Shutting down all workload partition processes.
lpar5ml162f_pub[/wpars/devpayrollWPAR01/wpars] >

 

To see how the process works while it is working, you will see the creation of the WPAR (see Listing 12).


Listing 12. Seeing the creation of the WPAR
 
                
 lpar5ml162f_pub[/] > lswpar
Name              State  Type  Hostname          Directory
-------------------------------------------------------------------------
MyTestWpar1       A      S     MyTestWpar1       /wpars/MyTestWpar1
MyTestWpar2       A      S     MyTestWpar2       /wpars/MyTestWpar2
devpayrollWPAR01  A      S     devpayrollWPAR01  /wpars/devpayrollWPAR01
evpayrollWPAR01   D      S     evpayrollWPAR01   /wpars/evpayrollWPAR01
templs1           T      A     templs1           /

 

When the process completes, it is gone, just as fast as it was created.


Listing 13. The process is gone
 
                
lpar5ml162f_pub[/] > lswpar
Name              State  Type  Hostname          Directory
-------------------------------------------------------------------------
MyTestWpar1       A      S     MyTestWpar1       /wpars/MyTestWpar1
MyTestWpar2       A      S     MyTestWpar2       /wpars/MyTestWpar2
devpayrollWPAR01  A      S     devpayrollWPAR01  /wpars/devpayrollWPAR01
evpayrollWPAR01   D      S     evpayrollWPAR01   /wpars/evpayrollWPAR01
lpar5ml162f_pub[/] >

 

Truthfully, although it's impressive that you can create application WPARs in a matter of seconds, and it's a feature that Solaris does not have, I think it is most useful for providing additional flexibility for testing purposes.



 

Summary

This article introduced WPARs and discussed the context in which to use them. The article looked at various scenarios in which WPARs should be used. It also discussed the installation, configuration, and administration of WPARs and how they relate to the global (LPAR) environment. You added users, created filesystems, and backed up WPARs. You also introduced utilities such as WPAR manager, which could be used to help manage the WPAR environment. You looked at the different types of WPARs that are available and the limitations of application WPARs compared to system WPARs. You also looked at scenarios in which WPARs may not be considered. The bottom line is that WPARs are an important innovation of AIX 6.1, and used judiciously, can increase your ability to effectively manage your system and reduce cost to the business.

Using Simple Network Management Protocol

The Simple Network Management Protocol (SNMP) is built in to many devices, but often the tools and software that can read and parse this information are too large and complicated when you only want to check a quick statistic or track a particular device or issue. This article looks at some simplified methods for getting SNMP information from your devices and how to integrate this information into the rest of your network's data map.

About this series

The typical UNIX® administrator has a key range of utilities, tricks, and systems he or she uses regularly to aid in the process of administration. There are key utilities, command line chains, and scripts that are used to simplify different processes. Some of these tools come with the operating system, but a majority of the tricks come through years of experience and a desire to ease the system administrator's life. The focus of this series is on getting the most from the available tools across a range of different UNIX environments, including methods of simplifying administration in a heterogeneous environment.



 

SNMP basics

There are many ways you can monitor your UNIX server. See the Resources for some examples of the type of monitoring available. Monitoring a single server is not a problem, but monitoring the same information across a number of servers can present problems. If one of the servers you are in charge of runs out of disk space, you want to know about it before it starts to affect your users and clients.

Monitoring multiple servers in this way, especially if they use a variety of different operating systems, can be a problem. The differences in command line tools, output formats, values, and other information all complicate what should otherwise be a simple process. What is required is a solution that provides a generic interface to the information that works, irrespective of the UNIX variant you are using.

The Simple Network Management Protocol (SNMP) provides a method for managing information about different systems. An agent runs on each system and reports information using SNMP to different managing systems.

SNMP is often a built-in component for network devices such as routers and switches, and is the only method available for retrieving statistics and status information remotely (without logging in to some sort of interface). On most hosts you will need to explicitly run SNMP software to expose information about the host over the SNMP protocol.

Information can be retrieved from an agent either explicitly, by requesting the information using a GET request, or the agent can broadcast information to management systems using the TRAP or INFORM messages. In addition, managing systems can set information and parameters on the agent, but this is usually only used to change the network configuration.

The types of information that can be shared can be quite varied. It can be everything from network settings, statistics, and metric data for network interfaces, through to monitoring CPU load and disk space.

The SNMP standard does not define what information the agent returns; instead, the available information is defined by Management Information Bases (MIBs). The MIB defines the structure of the information that is returned, and are organized into a hierarchical structure using object identifiers (OID). You access information within an agent by requesting data using a specific location within the MIB structure.

For example, some of the more common IDs are shown in Listing 1.


Listing 1. SNMP object IDs
 
                
sysDescr.0      1.3.6.1.2.1.1.1.0
sysObjectId.0   1.3.6.1.2.1.1.2.0
sysUpTime.0     1.3.6.1.2.1.1.3.0
sysContact.0    1.3.6.1.2.1.1.4.0
sysName.0       1.3.6.1.2.1.1.5.0
sysLocation.0   1.3.6.1.2.1.1.6.0
sysServices.0   1.3.6.1.2.1.1.7.0
ifNumber.0      1.3.6.1.2.1.2.1.0

 

You can see from this list that the MIBs are numerical and, effectively, in sequence. When obtaining information you can use a GET request to obtain a specific value, or GETNEXT to get the next property from the last one you read. You can also use the names. The names shown above are all part of the system tree, so you can read the value by getting using the OID 'system.sysUpTime.0'.

The values that you read are also of specific types. You can read integer, floating point, and string values that are all defined as 'scalar' objects. Within these objects are types that are identified with specific significance. For example, time interval values are reported as 'timeticks,' or hundredths of a second. These values need to be converted into a more readable human form before being displayed. There are also MIB objects that return tabular data. This is handled by returning additional OID instances that can be grouped together to make an SNMP table.

From a security perspective, SNMP agents can be associated with a specific community, and managing systems access information by using the community as a method of validating their access to the agent. In Version 1 of the SNMP standard, the community string was the only method of securing or restricting access. With Version 2 of the SNMP standard, the security was improved, but could be complex to handle. With Version 3, considered the current version since 2004, the standard was improved with explicit authentication and access control systems.



 

Getting SNMP statistics

There are many different ways of obtaining information from SNMP systems, including using professional management tools, programming interfaces, and command line tools.

Of the latter, probably the best known and easiest to use is the snmpwalk command, which is part of a larger suite of SNMP tools that allow you to obtain information from SNMP agents directly from the command line. This command will walk the entire subtree of a given management value and return all the information about the system contained within the subtree.

For example, Listing 2 shows the output when querying a local system for all the information within the 'system' tree.


Listing 2. 'Walking' an SNMP tree
 
                
$ snmpwalk -Os -c MCSLP -v 1 localhost system
sysDescr.0 = STRING: Linux tweedledum 2.6.23-gentoo-r8 
             #1 SMP Tue Feb 12 16:32:14 GMT 2008 x86_64
sysObjectID.0 = OID: netSnmpAgentOIDs.10
sysUpTimeInstance = Timeticks: (34145553) 3 days, 22:50:55.53
sysContact.0 = STRING: root@Unknown
sysName.0 = STRING: tweedledum
sysLocation.0 = STRING: serverroom
sysORLastChange.0 = Timeticks: (0) 0:00:00.00
sysORID.1 = OID: snmpFrameworkMIBCompliance
sysORID.2 = OID: snmpMPDCompliance
sysORID.3 = OID: usmMIBCompliance
sysORID.4 = OID: snmpMIB
sysORID.5 = OID: tcpMIB
sysORID.6 = OID: ip
sysORID.7 = OID: udpMIB
sysORID.8 = OID: vacmBasicGroup
sysORDescr.1 = STRING: The SNMP Management Architecture MIB.
sysORDescr.2 = STRING: The MIB for Message Processing and Dispatching.
sysORDescr.3 = STRING: The management information definitions for 
                                    the SNMP User-based Security Model.
sysORDescr.4 = STRING: The MIB module for SNMPv2 entities
sysORDescr.5 = STRING: The MIB module for managing TCP implementations
sysORDescr.6 = STRING: The MIB module for managing IP and ICMP implementations
sysORDescr.7 = STRING: The MIB module for managing UDP implementations
sysORDescr.8 = STRING: View-based Access Control Model for SNMP.
sysORUpTime.1 = Timeticks: (0) 0:00:00.00
sysORUpTime.2 = Timeticks: (0) 0:00:00.00
sysORUpTime.3 = Timeticks: (0) 0:00:00.00
sysORUpTime.4 = Timeticks: (0) 0:00:00.00
sysORUpTime.5 = Timeticks: (0) 0:00:00.00
sysORUpTime.6 = Timeticks: (0) 0:00:00.00
sysORUpTime.7 = Timeticks: (0) 0:00:00.00
sysORUpTime.8 = Timeticks: (0) 0:00:00.00

 

You can see here a range of information about the host, including the operating system (in sysDescr.0), the amount of time that the system has been available (sysUpTimeInstance), and the location of the machine. The interval time here is shown in both its original value (timeticks) and the converted, human-readable days, hours:minutes:seconds.

The uptime or availability of a machine is a very common use for SNMP, as it provides probably the most convenient and efficient method for determine whether a machine is up and processing requests. Other solutions that have been described in past parts of the series include ping or using rwho and ruptime. These latter two solutions are very CPU and network intensive and not very friendly in terms of their resource utilization.

Note, however, the limitation of the uptime described here, which is the information shown in the uptime of the SNMP agent, not the uptime of the entire machine. In most situations the two are same, especially for devices with built-in SNMP monitoring, such as network routers and switches. For computers that expose their status through SNMP, there may be a discrepancy between system and SNMP agent uptime.

You can get a quicker idea of the status of a machine through SNMP using snmpstatus. This obtains a number of data points from a specified SNMP agent, including the IP address, description, uptime, and network statistics (packets sent/received, and IP packets sent/received). For example, if we look at a Solaris host, you can see the simplified information, as shown in Listing 3.


Listing 3. Simplified information
 
                
$ snmpstatus -v1 -c public t1000
[192.168.0.26]=>[SunOS t1000 5.11 snv_81 sun4v] Up: 2:12:10.20
Interfaces: 4, Recv/Trans packets: 643/160 | IP: 456/60
2 interfaces are down!

 

This machine has recently been rebooted (hence the low uptime and packet statistics). The snmpstatus command has also determined that two of the interfaces on the machine (which has four Ethernet ports) are down. This is a good example of the sort of warning information that SNMP can provide to help notify you of an issue that requires further investigating.

For obtaining a specific piece of information, you can use the snmpget command, which reads one or more OIDs directly and reports their value. For special types, it will also convert to a human-readable format. For example, to get the system description and uptime, use the following command (in Listing 4).


Listing 4. Getting system description and uptime information
 
                
$ snmpget -v1 -c public t1000 system.sysUpTime.0 system.sysContact.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (867411) 2:24:34.11
SNMPv2-MIB::sysContact.0 = STRING: "System administrator"

 

In isolation, all of these methods are useful, but in reality, you need to be able to monitor and track multiple machines and multiple OIDs to get a full picture of what is going on. We can do this by using one of the many programmable interfaces to SNMP.



 

Getting SNMP data programmatically

The Net::SNMP module for Perl obtains information from one or more agents using SNMP. Other, similar, interfaces are available for other languages, including Python, Ruby, and PHP (see Resources). The interface works by you creating a session that communicates (and if necessary authenticates) with the SNMP agent on the desired host. Once you have an active and valid session, you can request data from the agent directly for one or more OIDs. The information is returned in the form of a hash of information, tied between the OID and the corresponding value.

Listing 5 shows a very simple script that will obtain the system uptime for each of the hosts supplied on the command line.


Listing 5. Getting a single SNMP agent property with Perl and Net::SNMP
 
                
#! /usr/local/bin/perl

use strict;

use Net::SNMP;

my $uptimeOID = '1.3.6.1.2.1.1.3.0';

foreach my $host (@ARGV)
{
    my ($session, $error) = Net::SNMP->session(
        -hostname  =>  $host,
        -community => 'public',
        -port      => 161
        );

    warn ("ERROR for $host: $error\n") unless (defined($session));

    my $result = $session->get_request(
        -varbindlist => [$uptimeOID]
        );

    if (!defined($result))
    {
        warn ("ERROR: " . $session->error . "\n");
    }
    else
    {
        printf("Uptime for %s: %s\n",$host, $result->{$uptimeOID});
    }

    $session->close;
}

 

In the script, we've provided the full numerical OID for the system, sysUpTime property. You have to supply the list of OIDs to obtain when using the get_request() method as a reference to an array, and then pull the information back out from the hash that is returned. In Listing 5 we build the array reference dynamically during the call, and then use the OID as the hash key when printing out the result.

Using the script, we can get a list of the uptimes for each host supplied on the command line (see Listing 6).


Listing 6. List of uptimes for each host
 
                
$ perl uptime.pl tweedledum t1000
Uptime for tweedledum: 4 minutes, 52.52
Uptime for t1000: 6 minutes, 26.12

 

Of course, watching this information manually is hardly efficient.


 

Tracking SNMP data over time

Viewing a single instance of an SNMP OID property at one time is not always very useful. Often you want to monitor something over time (for example, availability), or you want to monitor for changes in particular values. A good example is disk space. SNMP can be configured to record all sorts of information, and disk space is a common system to want to monitor so that you can identify not only when the disk space reaches a particular level, but also when there is a significant change to the disk space, which might signify a problem.

For example, Listing 7 shows a callback-based solution to constantly monitor the diskspace. In the script, we output a running total, but it could be configured to only output the warning message that is triggered when there is a reduction in the diskspace.


Listing 7. Getting a running view of SNMP properties
 
                
#! /usr/local/bin/perl

use strict;
use warnings;
use Net::SNMP qw(snmp_dispatcher);

my $diskspaceOID = '1.3.6.1.4.1.2021.9.1.7.1';

foreach my $host (@ARGV)
{
    my ($session, $error) = Net::SNMP->session(
        -hostname    => $host,
        -nonblocking => 0x1,
        );

    if (!defined($session))
    {
        warn "ERROR: $host produced $error - not monitoring\n"
    }
    else
    {
        my ($last_poll) = (0);

        $session->get_request(
            -varbindlist => [$diskspaceOID],
            -callback    => [
                 \&diskspace_cb, \$last_poll
            ]
            );
    }
}

snmp_dispatcher();

exit 0;

sub diskspace_cb
{
    my ($session, $last_poll) = @_;

    if (!defined($session->var_bind_list))
    {
        printf("%-15s  ERROR: %s\n", $session->hostname, $session->error);
    }
    else
    {
        my $space = $session->var_bind_list->{$diskspaceOID};

        if ($space < ${$last_poll})
        {
            my $diff = ((${$last_poll}-$space)/${$last_poll})*100;
            printf("WARNING: %s has lost %0.2f%% diskspace)\n",
                   $session->hostname,$diff);
        }

        printf("%-15s  Ok (%s)\n",
               $session->hostname,
               $space
               );

        ${$last_poll} = $space;
    }

    $session->get_request(
        -delay       => 60,
        -varbindlist => [$diskspaceOID]
        );
}

 

The script is in two parts, and uses some functionality within the Net::SNMP module that allows you to call a function when an SNMP value is obtained from a host, coupled with the ability to continually monitor hosts and SNMP objects in a simple, but efficient, loop.

The first part sets up each host to monitor the information. We are only monitoring one piece of information, but we could monitor others as part of the solution. The object is configured as 'non-blocking,' so that the script will not wait if the host cannot be reached, but simply move on to the next host. Finally, in the call to get_request(), we submit the callback information. The first argument here is the name of the function to be called when the response is received from the agent. The second is an argument that will be supplied to the function when it is called.

We'll use this argument to be able to record and track the previous value returned by the SNMP call. Within the callback function, we compare the newly returned value and the previous value. If there's a reduction, we calculate the percentage reduction and then report a warning.

The final part of the callback is to specify that another retrieval should occur, here specifying that the next retrieval should be delayed by 60 seconds. The existing callback information is retained. In effect, the script obtains the value from the SNMP agent, calls the callback function, which then queues up another retrieval in the future. Because the same callback is already defined, the process repeats in an endless loop.

Incidentally, the script uses the dskAvail OID value, and calculates the percentage difference based on the last and new values. The dskTable tree that this property is part of actually has a disk percentage property that we could have queried, instead of calculating it manually. However, the value returned is probably not finely grained enough to be useful.

You can see this property and current values by using snmpwalk to output the dskTable tree, which itself is part of the UCD MIB (Listing 8).


Listing 8. Getting a dump of available MIB data
 
                
$ snmpwalk -v 1 localhost -c public UCD-SNMP-MIB::dskTable
UCD-SNMP-MIB::dskIndex.1 = INTEGER: 1
UCD-SNMP-MIB::dskPath.1 = STRING: /
UCD-SNMP-MIB::dskDevice.1 = STRING: /dev/sda3
UCD-SNMP-MIB::dskMinimum.1 = INTEGER: 100000
UCD-SNMP-MIB::dskMinPercent.1 = INTEGER: -1
UCD-SNMP-MIB::dskTotal.1 = INTEGER: 72793272
UCD-SNMP-MIB::dskAvail.1 = INTEGER: 62024000
UCD-SNMP-MIB::dskUsed.1 = INTEGER: 7071512
UCD-SNMP-MIB::dskPercent.1 = INTEGER: 10
UCD-SNMP-MIB::dskPercentNode.1 = INTEGER: 3
UCD-SNMP-MIB::dskErrorFlag.1 = INTEGER: noError(0)
UCD-SNMP-MIB::dskErrorMsg.1 = STRING:

 

To find the property in the first place, you can dump all the known properties by using snmptranslate. By filtering this with grep we can see the information we want: $ snmptranslate -Ts |grep dsk.

To get a numerical value, use snmptranslate and provide the name with the -On option (see Listing 9).


Listing 9. Using snmptranslate
 
                
$ snmptranslate -On UCD-SNMP-MIB::dskAvail 
.1.3.6.1.4.1.2021.9.1.7

 

Running the script, we get a running commentary (and warnings) for the disk space usage on the specified host. See Listing 10.


Listing 10. Monitoring disk space automatically
 
                
$ perl diskspace-auto.pl tweedledum
tweedledum       Ok (50319024)
WARNING: tweedledum has lost 2.67% diskspace)
tweedledum       Ok (48976392)
WARNING: tweedledum has lost 1.65% diskspace)
tweedledum       Ok (48166292)
tweedledum       Ok (48166292)
tweedledum       Ok (48166292)
tweedledum       Ok (48166292)

 

You can see from this output that we have lost some significant space out of the space available on this disk on the specified host. To monitor more hosts, just add more hostnames on the command line.



 

Publishing information through an SNMP agent

The SNMP package includes a daemon, snmpd, which can be configured to expose a variety of information using the SNMP protocol. The configuration for the information to be exposed is controlled using the /etc/snmpd.conf file.

For example, Listing 11 shows the snmpd.conf file on the host used in the earlier examples in this article.


Listing 11. Sample snmpd.conf file
 
                
syslocation  serverroom
proc  imapd 20 10
disk  / 100000
load  5 10 10

 

Each of these lines populates different information. In the example, we set the location of the machine, and then configure some specific items to monitor.

The proc section monitors a specific process, shown here as a monitor for the IMAP daemons for a mail service. The numbers following the option specify the maximum number of processes allowed to be running, and the minimum number that should be running. You can use this to make sure that a particular service is running, and that you haven't exceeded capacity that might indicate a fault. When the process count goes above the MAX value, an SNMP trap is generated.

For the disk, you specify the path to the directory to be monitored and the minimum size (in kilobytes) that the disk should have free. Again, an SNMP trap is triggered if the disk space dips below this value.

Finally, the load information shows the maximum CPU load for 1, 5, and 15 minutes that should be reported. This is equivalent to the output of the uptime command that shows the process loading for these intervals. Like the other configured limits, a trap is raised when these limits are exceeded.

Manually setting this information is not difficult, but also not ideal. A simple menu-based solution, snmpconf, is available if you want a more straightforward method of setting the configuration.


 

Summary

Monitoring your servers and devices is a process that can be very complex, especially as the number of devices in your network increases. SNMP is an efficient, and extensible, method for exposing and reporting this information. Because the interface is consistent across all the devices, you can get uptime, network statistics, disk space, and even process monitoring using the same methods across multiple hosts.

In this article we've looked both at the basics of SNMP and also how to read specific values from different hosts. Using the Net::SNMP perl module we have also examined methods for reading information, using both one-hit and continual monitoring-based solutions. Finally, we examined the methods for configuration additional information to be exposed on a system so that you can customize and monitor the systems you need for your network when using the snmpd daemon.