Rename the service problem

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
phyo
Posts: 162
Joined: Sun Dec 01, 2013 10:50 pm

Re: Rename the service problem

Post by phyo »

Are you sure I can run the following commands?

Code: Select all

rm -f /usr/local/nagios/etc/hosts/*.*
rm -f /usr/local/nagios/etc/services/*.*
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Rename the service problem

Post by Box293 »

Yes, when you Apply Configuration they will be recreated from the database.

In the latest versions of XI there is a Delete button so you can do this in the GUI.

The whole point is to delete any ghost configuration files.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
phyo
Posts: 162
Joined: Sun Dec 01, 2013 10:50 pm

Re: Rename the service problem

Post by phyo »

Box293 wrote:Open an ssh session to nagios XI and execute these commands:

Code: Select all

rm -f /usr/local/nagios/etc/hosts/*.*
rm -f /usr/local/nagios/etc/services/*.*
Go into CCM
Quick Tools > Apply Configuration
Click the Apply Configuration button

Are they gone now?
I already tried. still there.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Rename the service problem

Post by Box293 »

Interesting.

What happens when you run these commands:

Code: Select all

cd /usr/local/nagiosxi/scripts/
./reconfigure_nagios.sh
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
phyo
Posts: 162
Joined: Sun Dec 01, 2013 10:50 pm

Re: Rename the service problem

Post by phyo »

Code: Select all

Running pre-flight check on configuration data...

Checking objects...
        Checked 555 services.
        Checked 45 hosts.
        Checked 8 host groups.
        Checked 2 service groups.
        Checked 15 contacts.
        Checked 4 contact groups.
        Checked 148 commands.
        Checked 18 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 45 hosts
        Checked 0 service dependencies
        Checked 0 host dependencies
        Checked 18 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Running configuration check...done.
Stopping nagios: .done.
Starting nagios: done.
Here is the status.

But after apply the configuration, old services and host are still there.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Rename the service problem

Post by lmiltchev »

Hm-m, seemingly, your configuration applies but no changes take place (deleted hosts/services are not removed). You already tried deleting all of the configs in the "hosts" and "services" directories in order to eliminate a possible "ghost" issue but this didn't fix the problem so I suspect there must be a permissions issue.

Run the following command from the CLI:

Code: Select all

/usr/local/nagiosxi/scripts/reset_config_perms
then go to the CCM and delete the "problem" hosts/services. Next run the Write Config Tool and check the output for errors. BTW, you don't have any configs in the "static" directory, do you?

If the issue is still present after performing the above steps, I would recommend opening a new email ticket in our system by emailing us your profile to [email protected].

Admin->System Profile->Download Profile
Be sure to check out our Knowledgebase for helpful articles and solutions!
phyo
Posts: 162
Joined: Sun Dec 01, 2013 10:50 pm

Re: Rename the service problem

Post by phyo »

Code: Select all

/usr/local/nagiosxi/scripts/reset_config_perms
I run this command and write the config. But the problem can't fix.

Code: Select all

BTW, you don't have any configs in the "static" directory, do you?
There are 3 files at /usr/local/nagios/etc/static/ folder.

Code: Select all

[root@nagios01 static]# pwd
/usr/local/nagios/etc/static
[root@nagios01 static]# ls
xiobjects.cfg  xitemplates.cfg  xitest.cfg
[root@nagios01 static]#

Code: Select all

If the issue is still present after performing the above steps, I would recommend opening a new email ticket in our system by emailing us your profile to [email protected].
This need the maintenance license. Right? currently we don't have the maintenance license.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Rename the service problem

Post by abrist »

phyo wrote:This need the maintenance license. Right? currently we don't have the maintenance license.
Yes, this does require a maintenance/support "license".
I noticed your hosts are grey - is this intended? I ask because that is a sign of db table issues or failed queries. What is the output of:

Code: Select all

grep query /var/log/messages | tail
And:

Code: Select all

tail -10 /var/log/mysql
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.
phyo
Posts: 162
Joined: Sun Dec 01, 2013 10:50 pm

Re: Rename the service problem

Post by phyo »

The output of grep query /var/log/messages | tail

Code: Select all

[root@nagios01 /]# grep query /var/log/messages | tail
Mar  2 16:06:22 nagios01 nagios: qh: core query handler registered
Mar  2 16:06:22 nagios01 nagios: wproc: Successfully registered manager as @wproc with query handler
Mar  2 17:56:01 nagios01 nagios: qh: core query handler registered
Mar  2 17:56:01 nagios01 nagios: wproc: Successfully registered manager as @wproc with query handler
Mar  2 17:56:45 nagios01 nagios: qh: core query handler registered
Mar  2 17:56:45 nagios01 nagios: wproc: Successfully registered manager as @wproc with query handler
Mar  2 23:46:58 nagios01 nagios: qh: core query handler registered
Mar  2 23:46:58 nagios01 nagios: wproc: Successfully registered manager as @wproc with query handler
Mar  2 23:48:17 nagios01 nagios: qh: core query handler registered
Mar  2 23:48:17 nagios01 nagios: wproc: Successfully registered manager as @wproc with query handler
[root@nagios01 /]#
The output of tail -10 /var/log/mysql

Code: Select all

[root@nagios01 /]# tail -10 /var/log/mysql
tail: cannot open `/var/log/mysql' for reading: No such file or directory
[root@nagios01 /]#
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Rename the service problem

Post by lmiltchev »

phyo, I believe Andy meant:

Code: Select all

tail -10 /var/log/mysqld.log
I am sorry about that! Can you show us the output of the command above?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked