Can't Acknowledge or Schedule Down Time (Not Authorized)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Can't Acknowledge or Schedule Down Time (Not Authorized)

Post by nscott »

I'm not seeing an alias in your nagios.conf to the actual /nagios. However I am confused as your nagios.conf had nagiosxi items in it, which shouldn't be.

However, try adding the following to your /etc/httpd/conf.d/nagios.conf

Code: Select all

Alias /nagios "/usr/local/nagios/share"
Then restart apache and try to access <your server>/nagios
Nicholas Scott
Former Nagios employee
espint
Posts: 29
Joined: Thu Mar 03, 2011 12:06 pm

Re: Can't Acknowledge or Schedule Down Time (Not Authorized)

Post by espint »

I added the line to /etc/httpd/conf.d/nagios.conf, and after apache restart I am able to access <my Server>/nagios.

However, I still cannot access the username field for scheduling downtime, or achknowledging alerts. I also am unable to add the line $cfg['use_https']=true; to /usr/local/nagiosxi/html/config.inc.php.

Which other Nagiosxi items shouldn't be in my nagios.conf?

Thanks
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Can't Acknowledge or Schedule Down Time (Not Authorized)

Post by mguthrie »

Here are some working configs for an XI install running SSL:

nagios.conf

Code: Select all

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>
nagiosxi.conf

Code: Select all

<Directory "/usr/local/nagiosxi/html">
#  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 XI"
#   AuthType Basic
#   AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
#   Require valid-user
</Directory>

Alias /nagiosxi "/usr/local/nagiosxi/html"

<VirtualHost *:443>
  SSLEngine on
  SSLCertificateFile /etc/pki/tls/certs/ca.crt
  SSLCertificateKeyFile /etc/pki/tls/private/ca.key
<Directory "/usr/local/nagiosxi/html">
  AllowOverride All
</Directory>
</VirtualHost>
espint
Posts: 29
Joined: Thu Mar 03, 2011 12:06 pm

Re: Can't Acknowledge or Schedule Down Time (Not Authorized)

Post by espint »

I can see that I got the two mixed together. I pasted in your configs. Apache would not start because the cert didn't exist. I change the name of the default CA to my certificates name for the key and the cert. Apache restarted. Nagiosxi works http or https so I added the line $cfg['use_https']=true; under $cfg['base_url']=”/nagiosxi”; in config.inc.php. Again I am getting the welcome screen, and when I click access nagiosxi the page goes white.

I also still cannot access the username field to acknowledge or schedule downtime. Perhaps I should remove all ssl configurations to see if that is causing the issue. Scheduling Downtime and Acknowledging an alert is more important to me.

Thanks again for your time.
espint
Posts: 29
Joined: Thu Mar 03, 2011 12:06 pm

Re: Can't Acknowledge or Schedule Down Time (Not Authorized)

Post by espint »

Good Morning,

I tried to do a backup on nagiosxi this morning and got this error message. I thought it might provide some insite as to the current issue.

Backing up MySQL databases...
mysqldump: Got error: 144: Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed when using LOCK TABLES
Error backing up MySQL database 'nagios' - check the password in this script!
You have new mail in /var/spool/mail/root
[root@monsrv003 ~]#

Thanks
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Can't Acknowledge or Schedule Down Time (Not Authorized)

Post by lmiltchev »

espint,

Did you follow our documentations on the Nagios XI backup?

http://assets.nagios.com/downloads/nagi ... ing_XI.pdf
Note: If you changed your MySQL root password to something different than “nagiosxi” (the default), you will need to edit the script and
change the mysqlpass= definition found in the first few lines of the script.
Be sure to check out our Knowledgebase for helpful articles and solutions!
espint
Posts: 29
Joined: Thu Mar 03, 2011 12:06 pm

Re: Can't Acknowledge or Schedule Down Time (Not Authorized)

Post by espint »

I did follow the documentation on Nagios XI backup, and backup has always worked in the past. I logged into mysql with the command mysql -uroot -pnagiosxi with no problems. I checked the backup script and the mysqlpass is nagiosxi. It seems like all of the issues are somehow related to username or password. I am considering restoring from a backup prior to these issues, but I wanted to make a backup of the current configuration first. If backup doesn't work I'm afraid to try a restore.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Can't Acknowledge or Schedule Down Time (Not Authorized)

Post by mguthrie »

If there's a crashed table, you'll need to repair the DB first. Run this procedure, then go ahead and try the backup again.

http://assets.nagios.com/downloads/nagi ... irdatabase
espint
Posts: 29
Joined: Thu Mar 03, 2011 12:06 pm

Re: Can't Acknowledge or Schedule Down Time (Not Authorized)

Post by espint »

I followed the procedure and repaired the database. I had this error:

- check record delete-chain
myisamchk: warning: Found 12428 deleted space in delete link chain. Should be 12444
myisamchk: error: Found more than the expected 76 deleted rows in delete link chain
myisamchk: error: record delete-link-chain corrupted
myisamchk: error: Quick-recover aborted; Run recovery without switch 'q'
Updating MyISAM file: nagios_systemcommands.MYI
MyISAM-table 'nagios_systemcommands.MYI' is not fixed because of errors
Try fixing it by using the --safe-recover (-o), the --force (-f) option or by not using the --quick (-q) flag

I tried running the command again with the -f option and the backup still fails with the same error.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Can't Acknowledge or Schedule Down Time (Not Authorized)

Post by mguthrie »

Try the following:

Code: Select all

cd /var/lib/mysql/nagios
myisamchk -r -f nagios_*.MYI
Locked