Page 1 of 1

Another bug. This time in importing contacts

Posted: Thu Sep 12, 2019 1:23 pm
by eloyd
More bugs in imports. This time, it's contacts. Similar to https://support.nagios.com/forum/viewto ... 16&t=55551, the following import stanza:

Code: Select all

define contact {
        contact_name            spacecadet
        use                     Auth Contact
        alias                   User spacecadet
        email                   [email protected]
}
Imports and writes back out to this:

Code: Select all

define contact {
    contact_name                     spacecadet
    alias                            User spacecadet
    email                            [email protected]
    use
}
I'm guessing it's the spaces in the "use" (or maybe it's the spaces in the thing the user points to). Maybe all keywords for the import class can be exempted instead of me finding them one at a time? :-)

Re: Another bug. This time in importing contacts

Posted: Thu Sep 12, 2019 2:21 pm
by scottwilkerson
this is a different issue, and I will say operator error, if I may...

What you are experiencing is what will happen if the contact template "Auth Contact" hasn't already been imported before you try to import the contact
To prevent errors or misconfigurations, you should import your configurations in an useful order. We recommend importing in the following order:

Commands -> Time Periods -> Contact Templates -> Contacts -> Contact Groups -> Host Templates -> Hosts -> Host Groups -> Service Templates -> Services -> Service Groups

Re: Another bug. This time in importing contacts

Posted: Thu Sep 12, 2019 2:32 pm
by eloyd
Yah, I know the import sequence. I've been doing some fine-toothed combing through the import files (which are from a Nagios-fork based product that rhymes with daemon and in the worst shape I've ever seen).

I literally just came here to write "I figured it out. Turns out the 'Auth Contact' wasn't properly defined with a register 0 statement and was being exported as a contact, not a contact template, so it wasn't put in the templates file to begin with."

Thanks again Scott. I'm pretty sure it's upstream (from me) user error. :)

Re: Another bug. This time in importing contacts

Posted: Thu Sep 12, 2019 2:33 pm
by scottwilkerson
eloyd wrote:Yah, I know the import sequence. I've been doing some fine-toothed combing through the import files (which are from a Nagios-fork based product that rhymes with daemon and in the worst shape I've ever seen).

I literally just came here to write "I figured it out. Turns out the 'Auth Contact' wasn't properly defined with a register 0 statement and was being exported as a contact, not a contact template, so it wasn't put in the templates file to begin with."

Thanks again Scott. I'm pretty sure it's upstream (from me) user error. :)
Sounds good!

Locking