Hi All,
We have a working nagios on SME 7. See below for the instructions. or you can follow from this link
http://forums.contribs.org/index.php?topic=35760.0Installing Nagios 2.9 on SME 7.1.3
First enable repo on Dag's
1. wget
http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt2. rpm --import RPM-GPG-KEY.dag.txt
3. From console do:
/sbin/e-smith/db yum_repositories set dag repository \
Name 'Dag - EL4' \
BaseURL '
http://apt.sw.be/redhat/el4/en/$basearch/dag' \
EnableGroups no \
GPGCheck yes \
GPGKey
http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt \
Visible no \
Exclude freetype,htop,iptraf,rsync,syslinux \
status disabled
4. expand-template /etc/yum.conf
Installing
1. yum --enablerepo=dag install nagios*
2. signal-event post-upgrade And signal-event reboot
3. mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
4. cd /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
5. vi 92nagios
6. paste this the code below and save/exit
{
$OUT = "";
my $allow = 'all';
my $pass = '0';
my $satisfy = 'all';
my $name = $nagios{'Name'} || 'Nagios';
for ('exit-if-none')
{
if ($nagios{'PublicAccess'})
{
if ($nagios{'PublicAccess'} eq 'none')
{
next;
}
elsif ($nagios{'PublicAccess'} eq 'local')
{
$allow = $localAccess;
$pass = 0;
$satisfy = 'all';
}
elsif ($nagios{'PublicAccess'} eq 'local-pw')
{
$allow = $localAccess;
$pass = 1;
$satisfy = 'all';
}
elsif ($nagios{'PublicAccess'} eq 'global')
{
$allow = 'all';
$pass = 0;
$satisfy = 'all';
}
elsif ($nagios{'PublicAccess'} eq 'global-pw')
{
$allow = 'all';
$pass = 1;
$satisfy = 'all';
}
elsif ($nagios{'PublicAccess'} eq 'global-pw-remote')
{
$allow = $localAccess;
$pass = 1;
$satisfy = 'any';
}
}
$OUT .= "#------------------------------------------------------------\n";
$OUT .= "# nagios - $name\n";
$OUT .= "#------------------------------------------------------------\n";
{
if (exists $nagios{'URL'})
{ $OUT .= "Alias /$nagios{'URL'} /usr/share/nagios\n"; }
}
$OUT .= "Alias /nagios/cgi-bin /usr/lib/nagios/cgi\n";
$OUT .= "\n";
$OUT .= "<Directory /usr/lib/nagios/cgi>\n";
$OUT .= " options ExecCGI\n";
$OUT .= " order deny,allow\n";
$OUT .= " deny from all\n";
$OUT .= " allow from $allow\n";
if ($pass)
{
$OUT .= " AuthName \"$name\"\n";
$OUT .= " AuthType Basic\n";
$OUT .= " AuthExternal pwauth\n";
$OUT .= " Satisfy $satisfy\n";
}
$OUT .= " AddType application/x-httpd-php .php .php3 .phtml\n";
$OUT .= "</Directory>\n";
$OUT .= "Alias /nagios /usr/share/nagios\n";
$OUT .= "\n";
$OUT .= "<Directory /usr/share/nagios>\n";
$OUT .= " order deny,allow\n";
$OUT .= " deny from all\n";
$OUT .= " allow from $allow\n";
if ($pass)
{
$OUT .= " AuthName \"$name\"\n";
$OUT .= " AuthType Basic\n";
$OUT .= " AuthExternal pwauth\n";
$OUT .= " require valid-user\n";
$OUT .= " Satisfy $satisfy\n";
}
$OUT .= " AddType application/x-httpd-php .php .php3 .phtml\n";
$OUT .= "</Directory>\n";
}
}
7. config set nagios service Name Nagios PublicAccess local-pw
8. expand-template /etc/httpd/conf/httpd.conf
restarting httpd
9. /etc/rc7.d/S86httpd-e-smith restart
10. /etc/rc7.d/S86httpd-admin restart
you'll need to setup nagios first, so go edit your /etc/nagios/<files> and then do a
10./etc/init.d/nagios start
To automatic start nagios
11. ln -s /etc/init.d/nagios /etc/rc.d/rc7.d/S99nagios
Pre-flight Check nagios configuration
1. /usr/bin/nagios -v /etc/nagios/nagios.cfg
or
nagios -v /etc/nagios/nagios.cfg
Right now you can access nagios thru this link
https://your-server-ip-address/nagios