HewlettPackard / nagios-plugins-hpilo

Nagios plug-in for iLO Agentless Management
Other
27 stars 11 forks source link

Version 1.5.1 RPM doesn't install on RHEL7 with Nagios version 4.2.4 #4

Open jeremyrogers opened 7 years ago

jeremyrogers commented 7 years ago

The RPM has a preinstall script with this:

##########################################################################

# Check if the Nagios has been installed
if [ ! -f /etc/init.d/nagios* ]; then
        echo "[Error]: Please make sure if you have installed nagios"
        exit 1
fi

exit 0
##########################################################################

In the newest version of Nagios (on RHEL7), they stopped using the init.d directory. This won't work even if Nagios is installed.

claychpe commented 7 years ago

Hi @jeremyrogers,

We are aware of this problem and plan to release a fix for it. Before we release the fix, would you try to get around the problem by creating a symbolic link of /etc/init.d to /etc/rc.d/init.d?

cd /etc
ln -s rc.d/init.d init.d 

Then the installation should work.

Tazzie02 commented 5 years ago

Hi @claychpe,

This is still an issue when trying to install on the Nagios XI VMware distribution. The symbolic link did not work for me, and I haven't seen a fix released yet.

There doesn't seem to be much activity for the past couple of years. Are there any plans to continue development?

Thanks in advance.

arjunharidasp commented 5 years ago

Hello All,

Please find the workaround for this problem.

Plugin installation rpm checks for the Nagios service startup file in the /etc/init.d directory to fetch Nagios configuration file and its location on the Nagios Server. But in RHEL 7, by default the Nagios service daemon is located in /usr/lib/systemd/ directory and it will not have such configuration details as part of systemd configuration. Due to this behavior installation will fail with the error below.

rpm -ivh nagios-plugins-hpeilo-1.5.1-156.4.rhel7.x86_64.rpm Preparing... ################################# [100%] [Error]: Please make sure if you have installed nagios error: %pre(nagios-plugins-hpeilo-1.5.1-156.4.rhel7.x86_64) scriptlet failed, exit status 1 error: nagios-plugins-hpeilo-1.5.1-156.4.rhel7.x86_64: install failed

Workaround To complete the plugin installation, please create a file with name nagios in /etc/init.d/ directory as root. Enter the following values in /etc/init.d/nagios file prefix= Nagios Installation path config=/Nagios Installation path/etc/nagios.cfg

Example: cat /etc/init.d/nagios prefix=/usr/local/nagios config=/usr/local/nagios/etc/nagios.cfg

Run the installation command now.

rpm -ivh nagios-plugins-hpeilo-1.5.1-128.37.rhel6.x86_64.rpm Preparing... ########################################### [100%] 1:nagios-plugins-hpeilo ########################################### [100%] Run configuration 'hpeiLO_nagios_config' script to setup passive/active discovery

Check for HPE iLO configuration files using the command mentioned below.

rpm -ql nagios-plugins-hpeilo /usr/local/nagios/libexec/hpeilo_nagios_config /usr/local/nagios/libexec/nagios_hpeilo_cfg_generator /usr/local/nagios/libexec/nagios_hpeilo_engine /usr/local/nagios/libexec/nagios_hpeilo_traps

Note : Restart Nagios Service after running the hpeiLO_nagios_config script either from Nagios Server backend or from Nagios XI dashboard

for restarting the service, Login to Nagios dashboard and click on apply configuration for the changes to take effect. Configure >> Core Config Manager >> Apply Configuration >> Apply Configuration

rupesh-arora-tm commented 2 years ago

After your workaround it works but after scanning this error is showing. Scan the network range: X.X.X.X.-X.X.X.X. with the total hosts 'X' env: /etc/init.d/nagios: Permission denied env: /etc/init.d/nagios: Permission denied env: /etc/init.d/nagios: Permission denied env: /etc/init.d/nagios: Permission denied env: /etc/init.d/nagios: Permission denied env: /etc/init.d/nagios: Permission denied env: /etc/init.d/nagios: Permission denied env: /etc/init.d/nagios: Permission denied env: /etc/init.d/nagios: Permission denied env: /etc/init.d/nagios: Permission denied