Oct 14

setup Nagios check_hpasm for hp servers

It is equally important to monitor hardware components of the servers specially cpu, RAM , fans etc while monitoring it’s application component.
Fortunately hp server provides more flexibility to monitor it’s hardware component compare to other vendors. This article guides you how to monitor
HP Proliant server hardware component using Nagios plugin called check_hpasm with SNMP. Same can be accomplished using nrpe plugin, but it doesn’t demonstrate here.

Configuration is divided into 2 sections. First section guides how to configure remote monitoring server which is going to be monitored by Nagios.
Last section is for Nagios Server. Let’s look at how to setup Nagios check_hpasm for hp servers .

Remote Server :-

IP : 192.168.10.50
OS : Centos 7.1

1) Install snmp

yum install net-snmp net-snmp-utils

2) Configure HP Repo

Please refer this for more details :-  http://downloads.linux.hpe.com/SDR/project/mcp/

—-This is for Centos 7.1, modify below repo according to your server. Refer above URL.
vim /etc/yum.repos.d/mcp.repo

[mcp]
name=Management Component Pack
baseurl=http://downloads.linux.hpe.com/SDR/project/mcp/repo/mcp/CentOS/7.0/x86_64/10.0
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/GPG-KEY-mcp

3) Install HP health and HP snmp agent

yum install hp-health
yum install hp-snmp-agents

4) configure HP snmp agent

type following on linux terminal with root privileges.
/sbin/hpsnmpconfig

here use following read only community string :- ROComm34ss
This community string will use Nagios server when it is retrieving snmp data from remote server which we do configuration at the moment.

5) Start snmp services

chkconfig hp-snmp-agents on
service hp-snmp-agents start
service snmpd start

Monitoring Server :-

This is the Nagios monitoring server.

1) Install Nagios

please refer this article, if don’t install nagios yet.
https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/quickstart.html

2) Install check_hpasm

https://labs.consol.de/nagios/check_hpasm/index.html

Download latest version or
https://labs.consol.de/assets/downloads/nagios/check_hpasm-4.7.1.1.tar.gz

3) Compile and install check_hpasm

Assuming nagios plugin directory is /usr/lib64/nagios/plugins.

./configure –prefix=/usr/lib64/nagios/plugins –with-nagios-user=nagios –with-nagios-group=nagios –enable-perfdata
make
make install

4) Confgure remote monitoring server setting

open or create *.cfg file for remote server.
vim /usr/local/nagios/etc/servers/test_svr.cfg

define service{
use                     generic-service
host_name               TEST_SVR
service_description     Server Information
check_command           check_hpasm
contact_groups          sysadmin
normal_check_interval   15; Check the service every x minutes under normal conditions
retry_check_interval    2;5; Re-check the service every x minutes until a hard state can be determined
}

5) Add check_hpasm commands.cfg

vim /usr/local/nagios/etc/objects/commands.cfg

define command {
command_name    check_hpasm
#command_line   $USER1$/check_hpasm $HOSTADDRESS$ -C $ARG1$
command_line   $USER1$/check_hpasm -H 192.168.10.50 -C ‘ROComm34ss’
}

6) Test connection

/usr/local/nagios/libexec/check_hpasm -H 192.168.10.50 -C ‘ROComm34ss’

snmp port should be opened at remote server.

7) Restart Nagios

Below is sample output of the Nagios which indicate memory error of the HP server.Nagios check_hpasm

 

 

 

 

 

 

 

 

 

Oct 09

Solved – Call to undefined function imagecreatefromjpeg

Even if you are installed php with gd, error message ” undefined function imagecreatefromjpeg () ” may appear on php. specifically when installing fresh opencart web application you may definitely face this issue as I did. In Opencart installation process, installer itself checks whether gd is installed, but unfortunately not identify the other important packages such as libJPEG and libPNG are installed or not. Here is how I fixed the that error on Centos.

Error!

Fatal error: Call to undefined function imagecreatefromjpeg() in /../library/image.php on line 34

(01) Install libjpeg and freetype

Centos :-
yum install libjpeg-devel
yum install freetype-devel

For Ubuntu :-
apt-get install libjpeg-dev
apt-get install libfreetype6-dev

(02) Configure and compile php

make clean
make distclean

***you must clean the php before configuring*
When compile gd extension, use the flag –with-jpeg-dir and –with-freetype-dir

no need to define directory(DIR) location of each flag if you are installed libjpeg and freetype using yum commands, otherwise it may be need to set DIR
location of each.

example php configuration
./configure –with-gd –with-jpeg-dir –with-freetype-dir

(03) Restart Apache

below is the sample output of php info file after successful installation.

php gd support verification

php gd support verification

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Cheers 😀

Sep 11

Reset HP iLO Administrator password over Linux terminal

HP Integrated Lights-Out (iLO) provides the automated intelligence to maintain complete server control from any place. It is awesome feature of HP servers to manage entire server remotely where physical access to the server is limited.Here I’m going to discuss how to reset existing iLO Administrator user password over Linux terminal remotely 🙂

1) Download and install hponcfg tool

You can download rpm file from one of below locations.
link1  , link2

most of the time default location would be “/usr/sbin/hponcfg”

2) Download HP Lights-Out XML Scripting Sample for Linux.

link1 , link2

3) Extract the “linux-ilosamplescripts1.80.0-1.tar.gz”.

There are bunch of scripts are available such as new user creation etc, but here I’m going to demonstrate how to reset password of existing user.

4) Let’s reset password

you need to change USER_LOGIN and PASSWORD value only.
in this example, assume system already has user called “admin” and new password for that user  is “Newpass@1234”

Notice

Change_Password.xml
<RIBCL VERSION="2.0">
  <LOGIN USER_LOGIN="adminname" PASSWORD="password">
  <USER_INFO MODE="write">
    <MOD_USER USER_LOGIN="admin">
      <PASSWORD value="Newpass@1234"/>
    </MOD_USER>
  </USER_INFO>
  </LOGIN>
</RIBCL>

 

5) try to login to ILO, now it should be working fine.

Older posts «

» Newer posts

Fetch more items