I update an old version of nagios to 4.1.1. Here is a transcript of what I did:

sudo su
cp -R /etc/nagios/ /home/jan/nagios-backup

yum install httpd php php-cli gcc glibc glibc-common gd gd-devel net-snmp

useradd nagios
passwd nagios
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache
cd /opt/
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.1.1.tar.gz
tar xzf nagios-4.1.1.tar.gz
cd nagios-4.1.1
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
service httpd restart
cd /opt
wget http://nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz
tar xzf nagios-plugins-2.1.1.tar.gz
cd nagios-plugins-2.1.1
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
cp /usr/local/nagios/etc/nagios.cfg /usr/local/nagios/etc/nagios.cfg.bak
cp /home/jan/nagios-backup/nagios.cfg /usr/local/nagios/etc/
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
service nagios restart
chkconfig --add nagios
chkconfig nagios on