Monday, August 29, 2011

How To Install Broadcom BCM4311, BCM4312, BCM4313, BCM4321, BCM4322, BCM43224, BCM43225, BCM43227 and BCM43228 Wireless NICs On CentOS 6

Hello Everybody,

Today, I am going to explain how to install Broadcom wireless NIC cards on CentOS 6.0. First, you should determine which Wlan chip or Wlan controller do you have. Login as root and run the following command:

[root@Centos6 ~]# lspci | grep Broadcom
02:00.0 Network controller: Broadcom Corporation BCM43224 802.11a/b/g/n (rev 01) 

As you see, my computer has BCM43224 Wlan chip. So, if your computer has one of the following Wlan chips or Wlan Network Controllers (BCM4311, BCM4312, BCM4313, BCM4321, BCM4322, BCM43224, BCM43225, BCM43227 and BCM43228), your computer will install the wireless after running the instructions below:

  1. yum install kernel-headers kernel-devel gcc 
  2. Go to this link **Click Here** and download the Broadcom Linux Driver (64 or 32 bits)
  3. mkdir -p /usr/local/khosro/taraghi-wl 
  4. cd /usr/local/khosro/taraghi-wl 
  5. tar xvfz /home/khosro/Download/hybrid-portsrc_x86_64-v5_100_82_38.tar.gz (You should change the path to the actual path of your tarball that you downloaded)
  6. make -C /lib/modules/`uname -r`/build/ M=`pwd`           ====>Your output should look something like this:
    make: Entering directory `/usr/src/kernels/2.6.32-71.29.1.el6.x86_64'
     LD      /usr/local/khosro/taraghi-wl/built-in.o
     CC [M]  /usr/local/
    khosro/taraghi-wl/src/shared/linux_osl.o
     CC [M]  /usr/local/
    khosro/taraghi-wl/src/wl/sys/wl_linux.o
     CC [M]  /usr/local/
    khosro/taraghi-wl/src/wl/sys/wl_iw.o
     LD [M]  /usr/local/
    khosro/taraghi-wl/wl.o
     Building modules, stage 2.
     MODPOST 1 modules
     CC      /usr/local/
    khosro/taraghi-wl/wl.mod.o
     LD [M]  /usr/local/
    khosro/taraghi-wl/wl.ko.unsigned
     NO SIGN [M] /usr/local/
    khosro/taraghi-wl/wl.ko
    make: Leaving directory `/usr/src/kernels/2.6.32-71.29.1.el6.x86_64'
  7. rmmod bcm43xx 
  8. rmmod b43 
  9. insmod wl.ko  ====> Load the driver module 
  10. cp -vi /usr/local/khosro/taraghi-wl/wl.ko /lib/modules/`uname -r`/extra/  
  11. depmod $(uname -r) ===> To create module dependencies
  12. vim /etc/modprobe.d/blacklist.conf     ===>And add the following lines under "# framebuffer drivers" to prevent these modules from being loaded into kernel at boot time:
blacklist bcm43xx
blacklist b43

Save the file. Now, you should see the available wirelesses under Wireless Network if you click on Wired Network icon ,usually, on top right.

Regards,
Khosro Taraghi

Friday, August 19, 2011

Monitoring Network Printers

This is a quick instructions about how to monitor the network printers in Nagios monitoring system. First important things that you should know is SNMP. Your printer should support the SNMP and also enabled on printer. HP printers that support internal/external JetDirect or other printers that support JetDirect protocol are good for this purpose.
Fisrt, we should install check_hpjd plugin.  To install this plugin, we should install net-snmp and net-snmp-utils packages.
yum install net-snmp
yum install net-snmp-utils
Next step, edit the main Nagios Configuration file:
vi /usr/local/nagios/etc/nagios.cfg
and uncomment this line:
#cfg_file=/usr/local/nagios/etc/objects/printer.cfg
and then save it. Now edit the printer configuration file and add new host definition for the networked printer that you want to monitor.
vi /usr/local/nagios/etc/objects/printer.cfg
This is the output of this file which is a sample and modify it according to your needs
# HOST DEFINITIONS
# Define a host for the printer we'll be monitoring
# Change the host_name, alias, and address to fit your situation

define host{
        use             generic-printer         ; Inherit default values from a template
        host_name       hplj2605dn              ; The name we're giving to this printer
        alias           HP LaserJet 2605dn      ; A longer name associated with the printer
        address         192.168.1.30            ; IP address of the printer
        hostgroups      network-printers        ; Host groups this printer is associated with
        }

# HOST GROUP DEFINITIONS
# A hostgroup for network printers

define hostgroup{
        hostgroup_name  network-printers        ; The name of the hostgroup
        alias           Network Printers        ; Long name of the group
        }
# SERVICE DEFINITIONS
# Create a service for monitoring the status of the printer
# Change the host_name to match the name of the host you defined above
# If the printer has an SNMP community string other than "public", change the check_command #directive to reflect that

define service{
        use                     generic-service         ; Inherit values from a template
        host_name               hplj2605dn              ; The name of the host the service is associated with
        service_description     Printer Status          ; The service description
        check_command           check_hpjd!-C public    ; The command used to monitor the service
        normal_check_interval   10      ; Check the service every 10 minutes under normal conditions
        retry_check_interval    1       ; Re-check the service every minute until its final/hard state is determined
        }

# Create a service for "pinging" the printer occassionally.  Useful for monitoring RTA, packet loss, etc.

define service{
        use                     generic-service
        host_name               hplj2605dn
        service_description     PING
        check_command           check_ping!3000.0,80%!5000.0,100%
        normal_check_interval   10
        retry_check_interval    1
        }

After editing this file, run the following command to make sure everything is fine, especially for spelling errors:
/usr/local/nagios/bin/nagios –v /usr/local/nagios/etc/nagios.cfg
It supposes to show 0 and 0 errors if these is no error.
And finally restart the service:
service nagios restart

All the best,
Khosro Taraghi