Installing Nagios-plugins and NRPE on Centos 6
Im reposting this so that I may find it again if i need it, ty to Askar Ali Khan Blog for the almost complete post, I’ve completed it with some reference from http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf on getting the client working.
To monitor remote hosts CPU load, disk partitions, processes etc with Nagios, requires to install NRPE and nagios-plugins on the remote host.
Nagios-plugins and NRPE is not available from Centos official repositories, so first of all we need to configure RPMforge> repo from where to install the required packages.
Read my previous article before configuring and installing anything from third party repo.
Installing RPMforge on Centos 6
Download and install the rpmforge-release package. Choose one of the two links below, selecting to match your host’s architecture. If you are unsure of which one to use you can check your architecture with the command uname -i
x386
# rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-1.el6.rf.i686.rpm
x86_64
# rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-1.el6.rf.x86_64.rpm
Do not forget to set the priority,
vi /etc/yum.repos.d/rpmforge.repo
[rpmforge]
name = RHEL $releasever – RPMforge.net – dag
baseurl = http://apt.sw.be/redhat/el6/en/$basearch/rpmforge
mirrorlist = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
priority=10
Now everything is setup now you can install nagios-plugins and nrpe packages from RPMforge repo
# yum install nagios-plugins nagios-nrpe
Running NRPE under xinetd
Edit /etc/xinetd.d/nrpe for
disable = no
only_from = 127.0.0.1 Nagios ServerIP
Add the following entry for the NRPE daemon to the /etc/services file.
nrpe 5666/tcp # NRPE
Its time to see if things are working properly…
Make sure the nrpe daemon is running under xinetd.
netstat -at | grep nrpe
The output out this command should show something like this:
tcp 0 0 *:nrpe *:* LISTEN
Restart xinetd service
# /etc/init.d/xinetd restart
I’ve moved house
As all things eventually come to an end, my good friend who had been hosting my site is closing shop, I needed to find another host, and the people from rockonhost seemed to offer everything standard for the lowest price so now I’m with them.
I’ve re-installed wordpress and everything seems to be working great out of the box, so a good start.
Hopefully everything works out alright
XAMPP Windows 7 Mysql Problem
I’ve kept having the problem where the mysql service on xampp would start only to die after a few seconds, I fixed this by installing xampp to my D: drive, far away from any windows permissions errors [ my windows is on the C: drive ].
Hope this helps someone
SMFPacks Nibogo shoutbox edit post problem fixed
In this mod that I installed on a client’s server, all the posts in the shoutbox containing the ‘ character were uneditable, so to fix that you need to open the shoutbox.js file [you'll find it in /themes/default], go to line 463 and replace:
msg = document.getElementById("shoutbox_message").value;
with
msg = document.getElementById("shoutbox_message").value;
msg= msg.replace("'","`");
This will replace all the ‘ characters with the ` character, very unnoticeable to users but allowing you to edit at will
Linux run level 3 change font color green
The one that worked and was permanent for me in CentOS was:
settern -foreground green -background black -store
Linux:See/Change environment variables for user
To see a list of environment variables for a user, you can use the $set command without any paramteres.
This enables you to see the names of the parameters, so you can potentially edit them in the file /homedir/.bashrc.
For example, if you append to the end of the file HISTFILE=/home/userhome/.history, after the next login, [su -l username], all of username’s history will be saved to that path instead of the default [ you can see the default with set | grep HISTFILE ]
Linux: Difference between login and non-login terminals
Whats the difference between the su username and su -l username you ask?
Well, the answer for that resides in the fact that each user has a set of global environment variables [ located in /etc/profile and /etc/bashrc ] and local environment variables [ located in /userhome/.bashrc ].
When you do a non-login comand [su username], only the global env variables are read [ the ones in /etc ] and the personal ones are inherited from the previous user.
While when you do the login-shell [ su -l username], both global and local environment variables are read [for example in the local .bashrc] the user might have customized the way his prompt looks, like here: http://www.pixelshine.net/howto/linux-store-user-environment-variables/
If used without the login-console feature, changes in that file would be ommited.
Linux: Store user environment variables
If you want to change the environment variables for a specific user ( like $PS1,$PS2 and so on ), you can edit their /home/username/.bashrc files.
For example, to change the way the prompt looks, you can add this line to the ending of the file
PS1= "touch me"
Now everytime that user loggs in, his command prompt will be “touch me:” instead of the standard.
Remember, you need to use the
su -l username
command to login [ instead of the su username ] command, in order for the custom /.bashrc file located in the user’s home directory to be read and implemented.
Linux Login as different user from the same console
The propper command for doing this is:
su username
After that you will be prompted for a password