Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Delete Host #35

Open
ghost opened this issue Aug 4, 2015 · 2 comments
Open

Cannot Delete Host #35

ghost opened this issue Aug 4, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 4, 2015

I know this is probably because I had a "/" in one of the host names in my csv. I cannot seem to get this host deleted. It looks like I cannot apply a new configuration until I get rid of it. Any ideas of a files I can change to get this out of there? Thanks in advance for your help!


- APPLYING NAGIOS CONFIGURATION (csv2nag -y all)

sudo: unable to resolve host OquawkaNAS
Creating hosts file local-nodes/dev/Master50/5revcrel.13.cfg
/usr/bin/csv2nag: line 619: local-nodes/dev/Master50/5revcrel.13.cfg: No such file or directory

THIS FILE WAS CREATED BY THE CSV2NAG SCRIPT

DON'T MODIFY THIS FILE. ALL CHANGES WILL BE OVERWRITTEN

define host {
use hsttmpl-contacts
host_name Master50/5revcrel.13
alias Master50/5revcrel.13
address 10.0.0.205
/usr/bin/csv2nag: line 628: 3: Bad file descriptor
/usr/bin/csv2nag: line 630: local-nodes/dev/Master50/5revcrel.13.cfg: No such file or directory
hostgroups dev
}

/usr/bin/csv2nag: line 798: 3: Bad file descriptor
Creating hostgroups file local_hostgroups.cfg

ERROR: Couldn't find Master50/5revcrel.13.cfg
Was this script run with hosts TYPE first?
Aborting


- NAGIOS CONFIGURATION CHECK (nagios -v /etc/nagios/nagios.cfg)

sudo: unable to resolve host OquawkaNAS

Nagios Core 3.4.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 05-11-2012
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config directory '/etc/nagios3/objects/local'...
Processing object config file '/etc/nagios3/objects/local/local_hostextinfo.cfg'...
Processing object config file '/etc/nagios3/objects/local/local_hostesc.cfg'...
Processing object config file '/etc/nagios3/objects/local/local_serviceesc.cfg'...
Processing object config directory '/etc/nagios3/objects/local/setup'...
Processing object config file '/etc/nagios3/objects/local/local_servicetemplates.cfg'...
Processing object config file '/etc/nagios3/objects/local/local_servicegroups.cfg'...
Processing object config file '/etc/nagios3/objects/local/local_servicedeps.cfg'...
Processing object config file '/etc/nagios3/objects/local/local_timeperiods.cfg'...
Processing object config file '/etc/nagios3/objects/local/local_hostgroups.cfg'...
Processing object config directory '/etc/nagios3/objects/local/local-nodes'...
Processing object config directory '/etc/nagios3/objects/local/local-nodes/dev'...
Processing object config file '/etc/nagios3/objects/local/local_serviceextinfo.cfg'...
Processing object config file '/etc/nagios3/objects/local/local_hosttemplates.cfg'...
Processing object config file '/etc/nagios3/objects/local/local_commands.cfg'...
Processing object config directory '/etc/nagios3/objects/local/versions'...
Processing object config file '/etc/nagios3/objects/local/local_contacts.cfg'...
Processing object config file '/etc/nagios3/objects/local/local_hostdeps.cfg'...
Processing object config directory '/etc/nagios3/objects/local/setup.known_good'...
Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
Error: There are no services defined!
Checked 0 services.
Checking hosts...
Error: There are no hosts defined!
Checked 0 hosts.
Checking host groups...
Checked 1 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Checked 3 contacts.
Checking contact groups...
Checked 1 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 50 commands.
Checking time periods...
Checked 2 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 2

***> One or more problems was encountered while running the pre-flight check...

 Check your configuration file(s) to ensure that they contain valid
 directives and data defintions.  If you are upgrading from a previous
 version of Nagios, you should be aware that some variables/definitions
 may have been removed or modified in this version.  Make sure to read
 the HTML documentation regarding the config files, as well as the
 'Whats New' section to find out what has changed.

Total Warnings: 0, Total Errors: 2


- SCHEDULING NAGIOS RESTART

NAGCTL ERROR: Config error. Nagios restart request not sent.

2015-08-04 09_22_21-water big picture vsdx - visio standard

@mclarkson
Copy link
Owner

I need to block this in the GUI, or allow it and fix it. The former is easier of course!

You'll need to edit the csv files manually to get rid of it.

I can't remember exactly the directory but if you do the following you will find the file to edit:

find /etc/nagios*/ -name "*_hosts.setup"

It should be in the setup/ directory, not last_known_good (or similar to that).

It's just a csv file so you can just delete the '/' character and all should be good.

@ghost
Copy link
Author

ghost commented Aug 4, 2015

Thanks for your quick response! I successfully got my hosts updated after deleting the hosts in the file at the exact path: "/volume1/@appstore/Synagios/nagios-chroot/etc/nagios3/objects/local/setup/local_hosts.setup"

@ghost ghost closed this as completed Aug 4, 2015
@mclarkson mclarkson reopened this Dec 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant