NagiosEnterprises / nagioscore

Nagios Core
GNU General Public License v2.0
1.48k stars 440 forks source link

Error Sending E-mail Notification If CONTACTEMAIL Variable Is Not Defined #878

Closed MasterChiefJon closed 1 year ago

MasterChiefJon commented 1 year ago

If I (intentionally) do not define an e-mail address for a contact (pager only), Nagios still tries to send the notification via e-mail, and fails with an error (stderr line 01: Send options without primary recipient specified.). How do I configure Nagios to actually check the CONTACTEMAIL variable, and if it is not defined, do not attempt to send a notification e-mail (but still send to the pager)?

MasterChiefJon commented 1 year ago

OK, I guess no one is supporting Nagios anymore. Anyway, I figured out how to do what I wanted. The generic-contact template defines that for every contact, they should receive a email and text (pager) notification. So for the two individual contacts in my environment that only use one or the other (email or pager), I modified their individual contact entry to only send host or service notifications to email or pager accordingly. The contact configuration options to only send to email OR pager for host and service notifications are: host_notification_commands notify-host-by-pager service_notification_commands notify-service-by-pager -OR- host_notification_commands notify-host-by-email service_notification_commands notify-service-by-email

ericloyd commented 1 year ago

You post something to a non-support online resource and in less than 24 hours come to the conclusion that no one is supporting the software anymore because you've received no reply? Interesting.

Support for all Nagios products is found by going to https://nagios.com, going to Resources, and choosing the Answer Hub. This will take you to the official community and company supported web site for Nagios where you can ask your question and get responses from people like me and from people like Nagios Enterprises.

THIS site is for questions and concerns related to creating and integration Nagios Core code. Not support. Having said that, I suggest you read up on how to create and code Nagios notifications at https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/notifications.html. I think you will find confirmation of your answer there. That is, in fact, a good place to start with all questions related to how Nagios works, rather than on a code repository issues page.

image

MasterChiefJon commented 1 year ago

@ericloyd Thank you for your response. My conclusion that no one was supporting the software anymore was not based on the fact that no one had responded to my request in 24 hours, it was based on the fact that the last response to ANY issue was 2/22/2022. Having said that, I do appreciate your answer distinguishing that the support for Nagios is not the code repository site (GitHub), but rather the community at Nagios.com. For anyone else reading this article, the link to that support is: https://support.nagios.com/forum/viewforum.php?f=7

ericloyd commented 1 year ago

Again, I'd say that this is a code repository, not a customer support site so even though I agree that five months is a long time between updates, I also get that code development is focused on Nagios XI and NCPA updates right now, so that's not a big surprise.

However, the forums that you link to are no longer officially supported by Nagios Enterprises. The Answer Hub that I linked to in my post (https://answerhub.nagios.com/support/s/) is the correct place for future discussions. The forum you linked to, however, is a great place for previous discussions. 😄