Not able to place servers into maintenance mode

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Not able to place servers into maintenance mode

Post by bsivavani »

Hi,

We are not able to place servers into maintenance mode.

We have observed that, we are not able to login to below URL with nagiosadmin and it is showing Authorization Required.
https://HOSTNAME/nagios/cgi-bin/cmd.cgi

Kindly advice ?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Not able to place servers into maintenance mode

Post by scottwilkerson »

So this was working in our remote session earlier.

As for logging in are you using the same password you use to login the the Nagios XI interface?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Re: Not able to place servers into maintenance mode

Post by bsivavani »

This login https://HOSTNAME/nagios/cgi-bin/cmd.cgi we didn't try in remote session.

Yes. I am using the same password.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Not able to place servers into maintenance mode

Post by scottwilkerson »

Lets force reset the password (you can use the same one if you like) from Admin -> Users
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Re: Not able to place servers into maintenance mode

Post by bsivavani »

Tried by resetting the password, but still we are seeing the same issue.

We are not able to login with any of local/AD user.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Not able to place servers into maintenance mode

Post by scottwilkerson »

Please post the output of the following:

Code: Select all

cat /etc/httpd/conf.d/nagios.conf
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Re: Not able to place servers into maintenance mode

Post by bsivavani »

Please find below output

[root@XXXXX ~]# cat /etc/httpd/conf.d/nagios.conf
# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file. Customize the paths, etc. as
# needed to fit your system.

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Core"
AuthType Basic
AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
Require valid-user
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Core"
AuthType Basic
AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
Require valid-user
</Directory>
[root@XXXXX ~]#
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Not able to place servers into maintenance mode

Post by scottwilkerson »

Can you show the output of

Code: Select all

ls -al /usr/local/nagiosxi/etc/htpasswd.users
Also, can you open the file and verify the user you are trying is in there (e.g. nagiosadmin)
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Re: Not able to place servers into maintenance mode

Post by bsivavani »

Please find below output
[root@XXXXX ~]# ls -al /usr/local/nagiosxi/etc/htpasswd.users
-rw-r--r-- 1 nagios apache 3261 Apr 17 15:02 /usr/local/nagiosxi/etc/htpasswd.users
[root@XXXXX ~]#

I see the file is empty
[root@XXXXX ~]# cat /usr/local/nagiosxi/etc/htpasswd.users
...
PROCESSED 0 COMMANDS
[root@XXXXX ~]#
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Not able to place servers into maintenance mode

Post by scottwilkerson »

the the file was overwritten Apr 17 15:02

bsivavani wrote:[root@XXXXX ~]# cat /usr/local/nagiosxi/etc/htpasswd.users
...
PROCESSED 0 COMMANDS
And this is not empty, the file literally contains

Code: Select all

...
PROCESSED 0 COMMANDS
Which is what the output from one of our cron would be, somehow it got copied into this file...

The only thing I can suggest is again restoring the backup from 4/16/2018 you had again.

Or, you could download that backup tarball and extract the above file and replace the current one from the backup
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked