Exchange Databases Unknown after editing .cfg file

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
billperrotta
Posts: 115
Joined: Fri Feb 21, 2014 11:44 am

Exchange Databases Unknown after editing .cfg file

Post by billperrotta »

My configuration used to work.

Now after adding additional databases I am getting this in my web browser.

Code: Select all

Accounts Payable
UNKNOWN	05-27-2014 09:33:00	 4d 19h 47m 31s	3/3	No handler for command: test_db
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Exchange Databases Unknown after editing .cfg file

Post by tmcdonald »

What do you mean by "adding additional databases"? Do you mean adding a new service to monitor a database?
Former Nagios employee
billperrotta
Posts: 115
Joined: Fri Feb 21, 2014 11:44 am

Re: Exchange Databases Unknown after editing .cfg file

Post by billperrotta »

I guess that is what I mean.
all the services I added after the fifth storage group are new.
see below. We reinstalled our exchange server so the old n++.ini configuration is lost.
Wish I even knew where to begin troubleshooting to fix this.

Code: Select all

define host{
use windows-server
host_name mailserver
alias mailserver
address 192.168.1.51
hostgroups corporate-servers,exchange-servers
parents Corporate
}

define service{
use generic-service
host_name mailserver
service_description C:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l C -w 90 -c 90
notification_interval 1440
notification_options w,r
notification_period work-holiday
servicegroups drivespace
}

define service{
use generic-service
host_name mailserver
service_description D:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l D -w 90 -c 95
notification_interval 1440
notification_options w,r
notification_period work-holiday
servicegroups drivespace
}

define service{
use generic-service
host_name mailserver
service_description F:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l F -w 90 -c 95
notification_interval 1440
notification_options w,r
notification_period work-holiday
servicegroups drivespace
}

define service{
use generic-service
host_name mailserver
service_description G:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l G -w 90 -c 95
notification_interval 1440
notification_options w,r
notification_period work-holiday
servicegroups drivespace
}

define service{
use generic-service
host_name mailserver
service_description J:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l J -w 90 -c 95
notification_interval 1440
notification_options w,r
notification_period work-holiday
servicegroups drivespace
}



define service{
use generic-service
host_name mailserver
service_description First Storage Group
check_command check_nrpe!test_db!1
notification_interval 30
notification_options c,r
servicegroups maildb
}

define service{
use generic-service
host_name mailserver
service_description Third Storage Group
check_command check_nrpe!test_db!3
notification_interval 30
notification_options c,r
servicegroups maildb
}

define service{
use generic-service
host_name mailserver
service_description Fourth Storage Group
check_command check_nrpe!test_db!4
notification_interval 30
notification_options c,r
servicegroups maildb
}

define service{
use generic-service
host_name mailserver
service_description Fifth Storage Group
check_command check_nrpe!test_db!5
notification_interval 0
servicegroups maildb
}

define service{
use generic-service
host_name mailserver
service_description Accounts Payable
check_command check_nrpe!test_db!6
notification_interval 30
notification_options c,r
servicegroups maildb
} 

define service{
use generic-service
host_name mailserver
service_description Banking
check_command check_nrpe!test_db!7
notification_interval 30
notification_options c,r
servicegroups maildb
} 

define service{
use generic-service
host_name mailserver
service_description Construction
check_command check_nrpe!test_db!8
notification_interval 30
notification_options c,r
servicegroups maildb
} 

define service{
use generic-service
host_name mailserver
service_description Labor
check_command check_nrpe!test_db!9
notification_interval 30
notification_options c,r
servicegroups maildb
}

define service{
use generic-service
host_name mailserver
service_description Taxes
check_command check_nrpe!test_db!10
notification_interval 30
notification_options c,r
servicegroups maildb
}

define service{
use generic-service
host_name mailserver
service_description Design
check_command check_nrpe!test_db!11
notification_interval 30
notification_options c,r
servicegroups maildb
}

define service{
use generic-service
host_name mailserver
service_description Executive
check_command check_nrpe!test_db!12
notification_interval 30
notification_options c,r
servicegroups maildb
}

define service{
use generic-service
host_name mailserver
service_description HR
check_command check_nrpe!test_db!13
notification_interval 30
notification_options c,r
servicegroups maildb
}

define service{
use generic-service
host_name mailserver
service_description IT
check_command check_nrpe!test_db!14
notification_interval 30
notification_options c,r
servicegroups maildb
}

define service{
use generic-service
host_name mailserver
service_description Legal
check_command check_nrpe!test_db!15
notification_interval 30
notification_options c,r
servicegroups maildb
}

define service{
use generic-service
host_name mailserver
service_description Training
check_command check_nrpe!test_db!16
notification_interval 30
notification_options c,r
servicegroups maildb
}

define service{
use generic-service
host_name mailserver
service_description Public Relations
check_command check_nrpe!test_db!17
notification_interval 30
notification_options c,r
servicegroups maildb
}

define service{
use generic-service
host_name mailserver
service_description Meetings
check_command check_nrpe!test_db!18
notification_interval 30
notification_options c,r
servicegroups maildb
}

define service{
use generic-service
host_name mailserver
service_description Real Estate
check_command check_nrpe!test_db!19
notification_interval 30
notification_options c,r
servicegroups maildb
}

define service{
use generic-service
host_name mailserver
service_description Reservation
check_command check_nrpe!test_db!20
notification_interval 30
notification_options c,r
servicegroups maildb
}

define service{
use generic-service
host_name mailserver
service_description Sales
check_command check_nrpe!test_db!21
notification_interval 30
notification_options c,r
servicegroups maildb
}

define service{
use generic-service
host_name mailserver
service_description Audit
check_command check_nrpe!test_db!22
notification_interval 30
notification_options c,r
servicegroups maildb
}
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Exchange Databases Unknown after editing .cfg file

Post by sreinhardt »

Based on the response from nsclient and your service command there, it seems that you need to setup the test_db command in the nsc.ini. Unfortunately without the previous one, it's nearly impossible for us to say what it might have been. Would any of your other systems have this command?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
billperrotta
Posts: 115
Joined: Fri Feb 21, 2014 11:44 am

Re: Exchange Databases Unknown after editing .cfg file

Post by billperrotta »

Very slim chance that one of my servers might. I am not entirely sure that the one exchange database store on the other server was monitored or not.
But I will check. No unfortunately that was the only Exchange Server that was having its databases monitored.
Wish I knew where to go from here? could I potentially put something into the file that would make it work?
I could just keep trying till I get it to work? All I did to add the additional databases to be monitored was try to modify my
statements to resemble the existing ones. All the databases appear by name after that but they show orange as unknown.
But the names appear correctly. and across from that the error No handler for command: test_db.
It is extremely easy to add drives to be monitored and that works when I add and remove them.
The first five databases were named accordingly. The new databases have names and I just named them in sequence.
I am very new to Nagios and I am the only one in my company that knows how to use it.
Another thought if the test_db command is failing, could I safely comment it out, or do you think something might be relying upon it?
Even if I can't put it back exactly as it was, I really just need to get it monitoring the exchange databases somehow.
Any suggesations would be appreciated.

Also my NSclient++ Serrvice is Green ok but I'm Getting

Code: Select all

It appears as though you do not have permission to view information for this service...
If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI
and check the authorization options in your CGI configuration file.
this is when I try drilling into it.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Exchange Databases Unknown after editing .cfg file

Post by sreinhardt »

As it's likely just a service, commenting that one definition out should be fine. what in particular are you looking to monitor regarding the databases? If we can get a handle on that, we can hopefully point you in a good direction of some powershell scripts or nsclient options that would help.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
billperrotta
Posts: 115
Joined: Fri Feb 21, 2014 11:44 am

Re: Exchange Databases Unknown after editing .cfg file

Post by billperrotta »

If I remember correctly all it did was say information store critical if a database was about to crash.
It actually would say first storage group down before MS Exchange itself knew it was down.

It monitored 1-5 exchange databases excluding 2nd which was the public folder contacts.

I don't know enough about nagios in able to know what to put in the nsclient.ini.

I am actually amazed that when the old admin left I was able to reset nagios and get everything going again.

So far this might be one of the most difficult things aside to commenting out the parent objects of a firewall which crashed nagios.

I'm also making an assumption the i would comment out the check_db in the mail.cfg file not in the nsclient.ini.

After the exchange server was reinstalled it went from 5 info store databases to 20.

I copied the statements from the old existing databases to try to get the same effect but got unknown on every database.

only weird thing is the names of databases show up with unknown next to every db and the check_db error.

Drives add perfectly fine and monitor what I set to monitor.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Exchange Databases Unknown after editing .cfg file

Post by abrist »

billperrotta wrote:If I remember correctly all it did was say information store critical if a database was about to crash.
It actually would say first storage group down before MS Exchange itself knew it was down.
So did you have two sets of checks - one group for your dbs and the other for your exchange storage groups?
We really need to know more about the checks and the plugins you were using to do these checks. Did you ever find one of the commands in and n++ file on any other server?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
billperrotta
Posts: 115
Joined: Fri Feb 21, 2014 11:44 am

Re: Exchange Databases Unknown after editing .cfg file

Post by billperrotta »

To answer that question I believe they may be one in the same.
In the beginning we only had 1-5 so thats what was being monitored.
just look at the file posted above. It only had only 1-5 that it was monitoring and it worked.
I added all the named dbs and then flight checked it. I don't know much about nagios so I
may have done it wrong. I only had the server side configuration to copy from.
No other server here were configured to monitor msexchange and the one with the configuration crashed..
The Network admin is opposed to nagios so even if he had an image of the c drive he probably wouldn't give it to me.
Nagios has been very useful so far. That is why I would appreciate if you are able to help me fix it.
only the first through fifth storage group was in the original mail.cfg. at that time all storage groups were monitored . i think from the file above you can tell
they were storage groups. they are called storage groups but have nrpe or db checks in them.
Is there any way and I keep repeating it. "I added all the Named Databases" They were not in the original configuration.
just the first 5. you know just as much as me by viewing the file above.

Any idea or suggesting to help figure this out is much appreciated.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Exchange Databases Unknown after editing .cfg file

Post by slansing »

Unfortunately, as sreinhardt said, without knowing exactly what test_db was, we have no way of knowing what you would want to place there, there could be any number of variations. You would need the plugin that was used, and how the command was defined as there may have been hard coded options you were using before. I would honestly look at the Exchange wizard that we have in Nagios XI and see how it sets up the command definitions, then re-create that in core.
Locked