enable cgi downtime scheduling in nagios

1. enable nagios.cmd access.

[root@james conf]# chmod -R 777 /usr/local/nagios/var/rw/
[root@james conf]# ls -la /usr/local/nagios/var/rw/
total 8
drwxrwxrwx 2 nagios nagios 4096 Dec 29 12:51 .
drwxrwxr-x 7 nagios nagios 4096 Dec 29 12:54 ..
prwxrwxrwx 1 nagios nagios 0 Dec 29 12:54 nagios.cmd
prwxrwxrwx 1 nagios nagios 0 Dec 27 16:02 nagios.cmd-old

2. add auth user to access cgi’s in cgi.cfg

use_authenticaiontion=1

add authenticated user (name of user logged in via .htaccess file) or * for all for following.

authorized_for_system_information=*
authorized_for_configuration_information=*
authorized_for_system_commands=*
authorized_for_all_services=*
authorized_for_all_hosts=*
authorized_for_all_service_commands=*
authorized_for_all_host_commands=*

3. nagios.cfg enable check_external_commands=1

4. restart nagios.

Dell OMSA (omreport) Yum Install on RHEL 5, 6

INSTALL on RHEL6

1.Archive to use for RHEL6.

OMSA 6.5 – wget http://ftp.us.dell.com/sysman/OM-SrvAdmin-Dell-Web-LX-6.5.0-2247.RHEL5.x86_64_A01.4.tar.gz

2.Required libraries are in yum repo.

yum install sblim-sfcb yum install sblim-sfcc yum install opensman-server yum install opensman-client

3.Run ./srvadmin-install.sh –express

INSTALL on RHEL 5

[root@lange ~]# wget -q -O – http://linux.dell.com/repo/hardware/latest/bootstrap.cgi | bash
Downloading GPG key: http://linux.dell.com/repo/hardware/latest/RPM-GPG-KEY-dell
Importing key into RPM.
Downloading GPG key: http://linux.dell.com/repo/hardware/latest/RPM-GPG-KEY-libs mbios
Importing key into RPM.
Write repository configuration
Downloading repository RPM
Installing repository rpm: http://linux.dell.com/repo/hardware/latest/platform_i ndependent/rh50_64/prereq/dell-omsa-repository-2-5.noarch.rpm
Installing yum plugins for system id
Loaded plugins: rhnplugin, security
dell-omsa-indep | 1.9 kB 00:00
dell-omsa-indep/primary | 97 kB 00:00
dell-omsa-indep 723/723
dell-omsa-specific | 1.9 kB 00:00
dell-omsa-specific/primary | 97 kB 00:00
dell-omsa-specific 723/723
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package yum-dellsysid.x86_64 0:2.2.26-6.2.el5 set to be updated
–> Processing Dependency: smbios-utils-python >= 2.2.0 for package: yum-dellsysid
–> Running transaction check
—> Package smbios-utils-python.x86_64 0:2.2.26-6.2.el5 set to be updated
–> Processing Dependency: python-smbios = 2.2.26-6.2.el5 for package: smbios-utils-python
–> Running transaction check
—> Package python-smbios.x86_64 0:2.2.26-6.2.el5 set to be updated
–> Processing Dependency: libsmbios = 2.2.26-6.2.el5 for package: python-smbios
–> Processing Dependency: python-ctypes for package: python-smbios
–> Running transaction check
—> Package libsmbios.x86_64 0:2.2.26-6.2.el5 set to be updated
—> Package python-ctypes.x86_64 0:1.0.2-1.1.el5 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================================
Installing:
yum-dellsysid x86_64 2.2.26-6.2.el5 dell-omsa-indep 16 k
Installing for dependencies:
python-ctypes x86_64 1.0.2-1.1.el5 dell-omsa-specific 215 k
python-smbios x86_64 2.2.26-6.2.el5 dell-omsa-specific 71 k
smbios-utils-python x86_64 2.2.26-6.2.el5 dell-omsa-specific 63 k
Updating for dependencies:
libsmbios x86_64 2.2.26-6.2.el5 dell-omsa-indep 1.5 M

Transaction Summary
=================================================================================================================================================================================
Install 4 Package(s)
Upgrade 1 Package(s)

Total download size: 1.9 M
Downloading Packages:
(1/5): yum-dellsysid-2.2.26-6.2.el5.x86_64.rpm | 16 kB 00:00
(2/5): smbios-utils-python-2.2.26-6.2.el5.x86_64.rpm | 63 kB 00:00
(3/5): python-smbios-2.2.26-6.2.el5.x86_64.rpm | 71 kB 00:00
(4/5): python-ctypes-1.0.2-1.1.el5.x86_64.rpm | 215 kB 00:00
(5/5): libsmbios-2.2.26-6.2.el5.x86_64.rpm | 1.5 MB 00:01
———————————————————————————————————————————————————————————
Total 657 kB/s | 1.9 MB 00:02
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : libsmbios 1/6
Installing : python-ctypes 2/6
Installing : python-smbios 3/6
Installing : smbios-utils-python 4/6
Installing : yum-dellsysid 5/6
Cleanup : libsmbios 6/6

Installed:
yum-dellsysid.x86_64 0:2.2.26-6.2.el5

Dependency Installed:
python-ctypes.x86_64 0:1.0.2-1.1.el5 python-smbios.x86_64 0:2.2.26-6.2.el5 smbios-utils-python.x86_64 0:2.2.26-6.2.el5

Dependency Updated:
libsmbios.x86_64 0:2.2.26-6.2.el5

Complete!
Loaded plugins: dellsysid, security
Cleaning up Everything
Done!

[root@lange ~]# yum install srvadmin-all
Loaded plugins: dellsysid, rhnplugin, security
dell-omsa-indep | 1.9 kB 00:00
dell-omsa-indep/primary | 97 kB 00:00
dell-omsa-indep 723/723
dell-omsa-specific | 1.9 kB 00:00
dell-omsa-specific/primary | 2.8 kB 00:00
dell-omsa-specific 7/7
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package srvadmin-all.x86_64 0:6.5.0-1.1.1.el5 set to be updated
–> Processing Dependency: srvadmin-base = 6.5.0 for package: srvadmin-all
–> Processing Dependency: srvadmin-webserver = 6.5.0 for package: srvadmin-all
–> Processing Dependency: srvadmin-rac4 = 6.5.0 for package: srvadmin-all
–> Processing Dependency: srvadmin-rac5 = 6.5.0 for package: srvadmin-all
–> Processing Dependency: srvadmin-storageservices = 6.5.0 for package: srvadmin-all
–> Processing Dependency: srvadmin-standardAgent = 6.5.0 for package: srvadmin-all
–> Processing Dependency: srvadmin-idrac = 6.5.0 for package: srvadmin-all
–> Running transaction check
—> Package srvadmin-base.x86_64 0:6.5.0-1.1.1.el5 set to be updated
–> Processing Dependency: srvadmin-omacore = 6.5.0 for package: srvadmin-base
–> Processing Dependency: srvadmin-smcommon = 6.5.0 for package: srvadmin-base
—> Package srvadmin-idrac.x86_64 0:6.5.0-1.228.2.el5 set to be updated
–> Processing Dependency: srvadmin-racadm4 = 6.5.0 for package: srvadmin-idrac
–> Processing Dependency: srvadmin-deng for package: srvadmin-idrac
–> Processing Dependency: srvadmin-rac-components for package: srvadmin-idrac
–> Processing Dependency: srvadmin-idrac-vmcli for package: srvadmin-idrac
–> Processing Dependency: srvadmin-idracadm for package: srvadmin-idrac
–> Processing Dependency: srvadmin-omilcore for package: srvadmin-idrac
–> Processing Dependency: srvadmin-racdrsc for package: srvadmin-idrac
–> Processing Dependency: srvadmin-omilcore for package: srvadmin-idrac
–> Processing Dependency: srvadmin-idrac-ivmcli for package: srvadmin-idrac
–> Processing Dependency: srvadmin-isvc for package: srvadmin-idrac
–> Processing Dependency: srvadmin-omcommon for package: srvadmin-idrac
–> Processing Dependency: srvadmin-argtable2 for package: srvadmin-idrac
—> Package srvadmin-rac4.x86_64 0:6.5.0-1.154.2.el5 set to be updated
–> Processing Dependency: srvadmin-racsvc = 6.5.0 for package: srvadmin-rac4
–> Processing Dependency: srvadmin-rac4-populator for package: srvadmin-rac4
—> Package srvadmin-rac5.x86_64 0:6.5.0-1.149.1.el5 set to be updated
–> Processing Dependency: srvadmin-racadm5 = 6.5.0 for package: srvadmin-rac5
—> Package srvadmin-standardAgent.x86_64 0:6.5.0-1.1.1.el5 set to be updated
–> Processing Dependency: srvadmin-itunnelprovider = 6.5.0 for package: srvadmin-standardAgent
—> Package srvadmin-storageservices.x86_64 0:6.5.0-1.1.1.el5 set to be updated
–> Processing Dependency: srvadmin-storage = 6.5.0 for package: srvadmin-storageservices
–> Processing Dependency: srvadmin-sysfsutils = 6.5.0 for package: srvadmin-storageservices
–> Processing Dependency: srvadmin-storelib = 6.5.0 for package: srvadmin-storageservices
—> Package srvadmin-webserver.x86_64 0:6.5.0-1.1.1.el5 set to be updated
–> Processing Dependency: srvadmin-iws = 6.5.0 for package: srvadmin-webserver
–> Processing Dependency: srvadmin-smweb = 6.5.0 for package: srvadmin-webserver
–> Running transaction check
—> Package srvadmin-argtable2.x86_64 0:6.5.0-3.1.el5 set to be updated
—> Package srvadmin-deng.x86_64 0:6.5.0-1.31.1.el5 set to be updated
—> Package srvadmin-idrac-ivmcli.x86_64 0:6.5.0-1.239.1.el5 set to be updated
–> Processing Dependency: libdchipm.so.5()(64bit) for package: srvadmin-idrac-ivmcli
—> Package srvadmin-idrac-vmcli.x86_64 0:6.5.0-1.254.1.el5 set to be updated
—> Package srvadmin-idracadm.x86_64 0:6.5.0-1.228.2.el5 set to be updated
—> Package srvadmin-isvc.x86_64 0:6.5.0-1.52.2.el5 set to be updated
—> Package srvadmin-itunnelprovider.x86_64 0:6.5.0-1.151.1.el5 set to be updated
–> Processing Dependency: openwsman-server >= 2.2.3 for package: srvadmin-itunnelprovider
–> Processing Dependency: sblim-sfcb >= 1.3.7 for package: srvadmin-itunnelprovider
–> Processing Dependency: libcmpiCppImpl.so.0()(64bit) for package: srvadmin-itunnelprovider
—> Package srvadmin-iws.x86_64 0:6.5.0-1.143.3.el5 set to be updated
–> Processing Dependency: srvadmin-jre for package: srvadmin-iws
–> Processing Dependency: libwsman_curl_client_transport.so.1()(64bit) for package: srvadmin-iws
–> Processing Dependency: libwsman.so.1()(64bit) for package: srvadmin-iws
–> Processing Dependency: libwsman_client.so.1()(64bit) for package: srvadmin-iws
—> Package srvadmin-omacore.x86_64 0:6.5.0-1.143.3.el5 set to be updated
–> Processing Dependency: libxmlsup.so.2()(64bit) for package: srvadmin-omacore
—> Package srvadmin-omcommon.x86_64 0:6.5.0-1.142.2.el5 set to be updated
—> Package srvadmin-omilcore.x86_64 0:6.5.0-1.452.1.el5 set to be updated
—> Package srvadmin-rac-components.x86_64 0:6.5.0-1.228.2.el5 set to be updated
—> Package srvadmin-rac4-populator.x86_64 0:6.5.0-1.154.2.el5 set to be updated
—> Package srvadmin-racadm4.x86_64 0:6.5.0-1.154.2.el5 set to be updated
—> Package srvadmin-racadm5.x86_64 0:6.5.0-1.149.1.el5 set to be updated
—> Package srvadmin-racdrsc.x86_64 0:6.5.0-1.228.2.el5 set to be updated
—> Package srvadmin-racsvc.x86_64 0:6.5.0-1.154.2.el5 set to be updated
—> Package srvadmin-smcommon.x86_64 0:6.5.0-1.201.2.el5 set to be updated
—> Package srvadmin-smweb.x86_64 0:6.5.0-1.201.2.el5 set to be updated
—> Package srvadmin-storage.x86_64 0:6.5.0-1.201.2.el5 set to be updated
—> Package srvadmin-storelib.x86_64 0:6.5.0-1.326.1.el5 set to be updated
–> Processing Dependency: srvadmin-storelib-sysfs-x86_64 for package: srvadmin-storelib
–> Processing Dependency: srvadmin-storelib-sysfs for package: srvadmin-storelib
—> Package srvadmin-sysfsutils.x86_64 0:6.5.0-1.1.el5 set to be updated
–> Running transaction check
—> Package libcmpiCppImpl0.x86_64 0:2.0.0Dell-3.1.el5 set to be updated
–> Processing Dependency: libwsman.so.1 for package: openwsman-client
—> Package libwsman1.x86_64 0:2.2.3.9-1.7.2.el5 set to be updated
—> Package openwsman-server.x86_64 0:2.2.3.9-1.7.2.el5 set to be updated
—> Package sblim-sfcb.x86_64 0:1.3.7-1.6.4.el5 set to be updated
—> Package srvadmin-hapi.x86_64 0:6.5.0-1.33.2.el5 set to be updated
—> Package srvadmin-jre.x86_64 0:6.5.0-1.145.1.el5 set to be updated
—> Package srvadmin-storelib-sysfs.x86_64 0:6.5.0-1.1.1.el5 set to be updated
—> Package srvadmin-xmlsup.x86_64 0:6.5.0-1.141.2.el5 set to be updated
–> Running transaction check
—> Package openwsman-client.x86_64 0:2.2.3.9-1.7.2.el5 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================================
Installing:
srvadmin-all x86_64 6.5.0-1.1.1.el5 dell-omsa-indep 2.5 k
Installing for dependencies:
srvadmin-argtable2 x86_64 6.5.0-3.1.el5 dell-omsa-indep 58 k
srvadmin-base x86_64 6.5.0-1.1.1.el5 dell-omsa-indep 2.4 k
srvadmin-deng x86_64 6.5.0-1.31.1.el5 dell-omsa-indep 695 k
srvadmin-hapi x86_64 6.5.0-1.33.2.el5 dell-omsa-indep 887 k
srvadmin-idrac x86_64 6.5.0-1.228.2.el5 dell-omsa-indep 2.8 k
srvadmin-idrac-ivmcli x86_64 6.5.0-1.239.1.el5 dell-omsa-indep 202 k
srvadmin-idrac-vmcli x86_64 6.5.0-1.254.1.el5 dell-omsa-indep 106 k
srvadmin-idracadm x86_64 6.5.0-1.228.2.el5 dell-omsa-indep 1.0 M
srvadmin-isvc x86_64 6.5.0-1.52.2.el5 dell-omsa-indep 7.0 M
srvadmin-itunnelprovider x86_64 6.5.0-1.151.1.el5 dell-omsa-indep 2.0 M
srvadmin-iws x86_64 6.5.0-1.143.3.el5 dell-omsa-indep 13 M
srvadmin-jre x86_64 6.5.0-1.145.1.el5 dell-omsa-indep 35 M
srvadmin-omacore x86_64 6.5.0-1.143.3.el5 dell-omsa-indep 1.9 M
srvadmin-omcommon x86_64 6.5.0-1.142.2.el5 dell-omsa-indep 4.2 M
srvadmin-omilcore x86_64 6.5.0-1.452.1.el5 dell-omsa-indep 30 k
srvadmin-rac-components x86_64 6.5.0-1.228.2.el5 dell-omsa-indep 99 k
srvadmin-rac4 x86_64 6.5.0-1.154.2.el5 dell-omsa-indep 2.7 k
srvadmin-rac4-populator x86_64 6.5.0-1.154.2.el5 dell-omsa-indep 32 k
srvadmin-rac5 x86_64 6.5.0-1.149.1.el5 dell-omsa-indep 2.8 k
srvadmin-racadm4 x86_64 6.5.0-1.154.2.el5 dell-omsa-indep 314 k
srvadmin-racadm5 x86_64 6.5.0-1.149.1.el5 dell-omsa-indep 971 k
srvadmin-racdrsc x86_64 6.5.0-1.228.2.el5 dell-omsa-indep 34 k
srvadmin-racsvc x86_64 6.5.0-1.154.2.el5 dell-omsa-indep 39 k
srvadmin-smcommon x86_64 6.5.0-1.201.2.el5 dell-omsa-indep 726 k
srvadmin-smweb x86_64 6.5.0-1.201.2.el5 dell-omsa-indep 18 M
srvadmin-standardAgent x86_64 6.5.0-1.1.1.el5 dell-omsa-indep 2.4 k
srvadmin-storage x86_64 6.5.0-1.201.2.el5 dell-omsa-indep 2.8 M
srvadmin-storageservices x86_64 6.5.0-1.1.1.el5 dell-omsa-indep 2.5 k
srvadmin-storelib x86_64 6.5.0-1.326.1.el5 dell-omsa-indep 303 k
srvadmin-storelib-sysfs x86_64 6.5.0-1.1.1.el5 dell-omsa-indep 44 k
srvadmin-sysfsutils x86_64 6.5.0-1.1.el5 dell-omsa-indep 51 k
srvadmin-webserver x86_64 6.5.0-1.1.1.el5 dell-omsa-indep 2.4 k
srvadmin-xmlsup x86_64 6.5.0-1.141.2.el5 dell-omsa-indep 52 k
Updating for dependencies:
libcmpiCppImpl0 x86_64 2.0.0Dell-3.1.el5 dell-omsa-indep 95 k
libwsman1 x86_64 2.2.3.9-1.7.2.el5 dell-omsa-indep 324 k
openwsman-client x86_64 2.2.3.9-1.7.2.el5 dell-omsa-indep 61 k
openwsman-server x86_64 2.2.3.9-1.7.2.el5 dell-omsa-indep 174 k
sblim-sfcb x86_64 1.3.7-1.6.4.el5 dell-omsa-indep 1.4 M

Transaction Summary
=================================================================================================================================================================================
Install 34 Package(s)
Upgrade 5 Package(s)

Total download size: 91 M
Is this ok [y/N]:

[root@lange srvadmin]# bash /opt/dell/srvadmin/sbin/srvadmin-services.sh start
Starting Systems Management Device Drivers:
Starting dell_rbu: [ OK ]
Starting ipmi driver: Already started [ OK ]
Starting Systems Management Data Engine:
Starting dsm_sa_datamgrd: [ OK ]
Starting dsm_sa_eventmgrd: [ OK ]
Starting dsm_sa_snmpd: [ OK ]
Starting DSM SA Shared Services: [ OK ]

Starting DSM SA Connection Service: [ OK ]

Setup Comcast as Relay Host for Postfix Mail.

root@donkey:~# grep -ir “smtp.comcast.net” /etc/
Binary file /etc/postfix/sasl_passwd.db matches
/etc/postfix/main.cf:relayhost = [smtp.comcast.net]:587
/etc/postfix/sasl_passwd:smtp.comcast.net < username >:< password >

Restart postfix.

!!Run this after modifiying sasl_passwd file

[root@mail postfix]# postmap hash:/etc/postfix/sasl_passwd

Verify System Manufacture in Linux

I have a bash script where i need to determine if the system is Dell or Non-Dell for add-on software. I looked around on ‘the google’ and found that you can determine the system manufacturer by running the below command.

[root@stone ~]# dmidecode | grep Dell
Vendor: Dell Inc.
Manufacturer: Dell Inc.
Manufacturer: Dell Inc.
Manufacturer: Dell Inc.
String 1: Dell System

[root@stone ~]# dmidecode -s system-product-name
PowerEdge 2950

[root@stone ~]# dmidecode -s bios-version
2.7.0

[root@stone ~]# dmidecode -s system-serial-number
6GV2KH1

Here are all the available options…

[root@stone ~]# dmidecode -s
dmidecode: option requires an argument — s
String keyword expected
Valid string keywords are:
bios-vendor
bios-version
bios-release-date
system-manufacturer
system-product-name
system-version
system-serial-number
system-uuid
baseboard-manufacturer
baseboard-product-name
baseboard-version
baseboard-serial-number
baseboard-asset-tag
chassis-manufacturer
chassis-type
chassis-version
chassis-serial-number
chassis-asset-tag
processor-family
processor-manufacturer
processor-version
processor-frequency