[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4752: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4754: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4755: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4756: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
forum.nconf.org • View topic - Escalations (Service / Advanced Services / Hosts)
Page 1 of 2

Escalations (Service / Advanced Services / Hosts)

PostPosted: Mon Feb 04, 2013 12:11
by pebr

Re: Escalations (Service / Advanced Services / Hosts)

PostPosted: Wed Apr 03, 2013 18:02
by Guest
How would this work for host escalations? The php code is just for service escalations.

Re: Escalations (Service / Advanced Services / Hosts)

PostPosted: Thu Apr 04, 2013 07:25
by pebr
As you can see in the first INSERT INTO it also creates Host Escalations. The Diff is for "Advanced Services" - without the Code the "Nconf friendly Name" ist put into nagios.conf which won't work...

Re: Escalations (Service / Advanced Services / Hosts)

PostPosted: Thu Apr 04, 2013 17:57
by guest
I think I have the database side of things setup correctly. The image here shows the Nconf attributes for the hostescalation class. Does it look correct? Would a dump of this part of the database be better to look at?

When I try to setup a host escalation and generate the nagios config I get an error, which makes me think it's that php code for ExportNagios.pm.
(Also, sorry I'm only logged in as a guest...I haven't been granted approval for my username I requested yet.)

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config file '/sites/nconf/temp/global/escalations.cfg'...
Processing object config file '/sites/nconf/temp/global/timeperiods.cfg'...
Processing object config file '/sites/nconf/temp/global/contacts.cfg'...
Processing object config file '/sites/nconf/temp/global/misccommands.cfg'...
Processing object config file '/sites/nconf/temp/global/checkcommands.cfg'...
Processing object config file '/sites/nconf/temp/global/host_templates.cfg'...
Processing object config file '/sites/nconf/temp/global/service_templates.cfg'...
Processing object config file '/sites/nconf/temp/global/contactgroups.cfg'...
Processing object config file '/sites/nconf/temp/Default_collector/service_dependencies.cfg'...
Processing object config file '/sites/nconf/temp/Default_collector/host_dependencies.cfg'...
Processing object config file '/sites/nconf/temp/Default_collector/advanced_services.cfg'...
Processing object config file '/sites/nconf/temp/Default_collector/services.cfg'...
Processing object config file '/sites/nconf/temp/Default_collector/servicegroups.cfg'...
Processing object config file '/sites/nconf/temp/Default_collector/hosts.cfg'...
Error: Invalid host object directive 'hostescalation'.
Error: Could not add object property in file '/sites/nconf/temp/Default_collector/hosts.cfg' on line 1685.

Error processing object config files!

Image

Re: Escalations (Service / Advanced Services / Hosts)

PostPosted: Fri Apr 05, 2013 07:59
by pebr
You didn't use the INSERT INTO statements from me, right?

My host-escalation (note the different writing) looks like this:



I don't think it's the php code since host-escalation don't need any change. The php change is only for advanced-service escalations. It's a faulty Setting for your attribute

Edit:
Change "write attribute to configuration?" to "No" for your PK "hostescalation"

Re: Escalations (Service / Advanced Services / Hosts)

PostPosted: Fri Apr 05, 2013 11:06
by Lijiman

Re: Escalations (Service / Advanced Services / Hosts)

PostPosted: Fri Apr 05, 2013 11:54
by pebr
You could use my Insert Statements if you change the IDs (matching in ConfigClasses and ConfigAttributes) to the next free values. In fact you could also do it by hand, the settings I posted here are working on 6 Sites now without any trouble. You have a lot more ConfigAttributes than I have - maybe some of them are configured wrong

Re: Escalations (Service / Advanced Services / Hosts)

PostPosted: Fri Apr 05, 2013 20:53
by Lijiman

Re: Escalations (Service / Advanced Services / Hosts)

PostPosted: Fri Apr 05, 2013 21:58
by Lijiman
D'oh, nevermind! You assign it from host escalation, not from the host itself. So now I'm waiting for my testing to confirm host escalations...then to tackle service escalations with the php code. :D :D :D

Re: Escalations (Service / Advanced Services / Hosts)

PostPosted: Fri Apr 05, 2013 22:29
by Lijiman

Re: Escalations (Service / Advanced Services / Hosts)

PostPosted: Mon Apr 08, 2013 08:08
by pebr
No, the Bracket shouldn't be an extra - this is a diff from a working installation so it should be needed - and the php code is only for advanced-services! If you stick with "normal" services for escalation only (for testing) the php code doesn't matter. Let's stick with a single service escalation (no advanced-services) for the beginning. The Default-Collector failure is not necessary an escalation Problem.

Re: Escalations (Service / Advanced Services / Hosts)

PostPosted: Mon Apr 08, 2013 16:16
by Lijiman
Ok, I have tried with and without the bracket and got that failure...sorry should have mentioned it earlier. I'm using only advanced services on several nagios installations, so I'll have to go the php code fix route. I'll work on it today again.

EDIT: I only get the Default-Collector failure when adding that code block to ExportNagios.pm. If I remove the code it will generate the config successfully.

Re: Escalations (Service / Advanced Services / Hosts)

PostPosted: Tue Apr 09, 2013 07:49
by pebr
I can't understand that - but if you use different "advanced service name" than "service description" for an advanced-service the generated config should throw an error - and for this case the php workaround is needed

Edit:
Did you apply the diff by hand? Or did you use patch?
Nevermind - i didn't ever post the patch version until now...

Edit2:
You could enable debug - then the modified file will print some debug lines when it's replacing certain advanced-service-names

Re: Escalations (Service / Advanced Services / Hosts)

PostPosted: Tue Apr 09, 2013 20:11
by Lijiman
Wow, I'm just dumb. I didn't remove the } before the code block, which is why I thought the very last closing } was an extra one.

pebr, thank you very very much for your help on this!!! :D :D

Re: Escalations (Service / Advanced Services / Hosts)

PostPosted: Wed Apr 10, 2013 07:58
by pebr
Glad to hear everything is working now! :)