Page 1 of 2
default nagios contact
Posted: Thu Apr 01, 2021 11:06 am
by rzietlow
Good morning we have some auditors who are asking to show that our nagios alerts are coming to the correct group. And instead of seeing our emails they want to see the actual config.
when I look at the system we have the nagiosadmin account having the email "nagios@localhost" as their email. When I look at contact template it's xi_contact_generic. When I look at this contact template I don't see any email address or anything associated with an email that the notifications are sent to.
when I go on the file system and grep for our contact information, I don't find anything when searching in /usr/local with a 'grep -ri <term> *' I don't find anything that shows our groups email address, again despite having emails that show it's working. I looked in /etc/aliases for the same thing. looked at the DB some but those joins are above my level of sql knowledge.
Where can I find that nagiosadmin and xi_contact_generic
Re: default nagios contact
Posted: Thu Apr 01, 2021 2:49 pm
by dchurch
If you're looking for emails, In lieu of having an internet email address configured for that contact, they will have gone into the "nagios" (unix user)'s mail spool at /var/spool/mail/nagios. You can read them with the "mailx" program or "mutt."
If you're looking for where that's set, it would be set up in the Nagios XI configuration database under Config => Core Config Manager => Contacts.
Email settings can be changes if you go to Admin (top menu) => Email Settings (left menu).
Nagiox XI users and contacts:
https://assets.nagios.com/downloads/nag ... ntacts.pdf
Is there something specific you'd like it to do regarding notification emails?
Re: default nagios contact
Posted: Thu Apr 01, 2021 3:05 pm
by rzietlow
we want to see how nagiosadmin is sending emails to our
[email protected]
when I look at config -> core config manger -> contacts I see nagiosadmin. Which is one of our primary contacts. Under that email address it's listed as "nagios@localhost" I see this nagiosadmin user is also part of a contact template. This contact template is "xi_contact_generic"
when I look at the contact templates, I see xi_contact_generic listed. but within that template there isn't
[email protected]. But this also points to xi_contactgroup_all...which when I goto that contact group also doesn't have any email address listed.
Basically auditors are saying "we see that emails are being sent to
[email protected] do we know, and how can you be sure it's sending them to your
[email protected] email address.
basically where in the application does nagios@localhost or nagiosadmin ==
[email protected]
Re: default nagios contact
Posted: Thu Apr 01, 2021 4:40 pm
by dchurch
Setting the email address in the contact template "xi_contact_generic" to anything isn't the default in Nagios XI. Base installations have this blank.
The fact that it's set only really means that all contacts
without an email address set will by default have the email address set in the template. If they set one, it overrides this you see.
More on how template inheritance works:
https://assets.nagios.com/downloads/nag ... tance.html
If you want to have your @company.com email emailed whenever nagiosadmin is notified, then set that as their email address, and turn on email notifications (in the profile).
Re: default nagios contact
Posted: Fri Apr 02, 2021 8:14 am
by rzietlow
no, I don't want to set anything I want a screenshot to show what the current email address is. We can show the incoming emails that we have received day in and day out for various alerts, but they want to see it within the nagios configuration itself. We don't want to set anything we just want to show auditors.
we have had our setup for 8-9 years and it works well. A few weeks ago i did a full migration from an hold RHEL6 box to a newer box. I did a backup & import which worked flawlessly. Somewhere our existing contact is set and it's emailing us, as it should be. Auditors want to see a screenshot or some form of system documentation showing that it is indeed emailing our group.
I did a grep for our contact email address in the raw files within /usr/local/ and no configuration files, only the daily scheduled report log,.
Somewhere it's set to
[email protected] and we need to show where that is. We don't want to set anything. Maybe our config is screwed up (but working as intended) and we need to configure it correctly.
Re: default nagios contact
Posted: Fri Apr 02, 2021 9:21 am
by dchurch
If you PM me a system profile I can figure out exactly where it's set. Get one by going to Admin (top menu) => System Profile (in the left menu), then clicking the blue button.
If you're unable to generate the the profile through the web interface, please try generating it from the command line by running these commands as root:
Code: Select all
rm -rf /usr/local/nagiosxi/var/components/profile*
/usr/local/nagiosxi/scripts/components/getprofile.sh SUPPORT
Then send me the resulting
/usr/local/nagiosxi/var/components/profile.zip file.
If the profile script fails, please include the ENTIRE output.
Re: default nagios contact
Posted: Fri Apr 02, 2021 2:24 pm
by dchurch
It looks as if xi_default_contact is defined under static configuration file xiobjects.cfg. You can see this in the Nagios XI command center by going to Core Config Manager => Static Config Editor.
Re: default nagios contact
Posted: Mon Apr 05, 2021 9:39 am
by rzietlow
ok again I just want to view & screenshot, I don't want to edit.
when I look at that I see this:
cat /usr/local/nagios/etc/static/xiobjects.cfg
####################################################
# CONTACTS
####################################################
define contact {
contact_name xi_default_contact
email root@localhost
alias Default Contact
host_notification_commands xi_host_notification_handler
service_notification_commands xi_service_notification_handler
host_notification_period xi_timeperiod_none
service_notification_period xi_timeperiod_none
host_notification_options n
service_notification_options n
}
####################################################
# TIMEPERIODS
####################################################
define timeperiod {
timeperiod_name xi_timeperiod_none
alias None
}
if I do a "echo test" | mail root@localhost I don't receive an email. so it seems soemthing set within nagios and not within the OS itself.
Re: default nagios contact
Posted: Mon Apr 05, 2021 9:43 am
by rzietlow
Is there a phone number or something I can call to look at this? we need to have this soon for our auditors.
Re: default nagios contact
Posted: Mon Apr 05, 2021 12:19 pm
by dchurch
I wasn't able to find any place in your config where
[email protected] was mentioned. That email address sounds fake, are you sure you have control of that email address?
Perhaps postfix on localhost is re-routing the email to a different address, what's the output for the following command?