Page 1 of 2

Nagiosxi does not send mail via contacts

Posted: Fri Dec 25, 2020 2:36 pm
by diegosiassb
Hi all,
Created a new contacts named Sistemisti_linux. (generic-contact)
I add a new host , hostgroup and one service but not receive alerts when power off the monitored host.
Nagios shows that the notifications are sent, but the contact is not receiving them
Although the Test Send Email Is received. ( i try with my account not contact Sistemisti_linux but i think is the same)
Notifications is appeared in the console.

I am using Contacts only:
notify-host-by-email and notify-service-by-email


Thanks
Diego

Re: Nagiosxi does not send mail via contacts

Posted: Fri Dec 25, 2020 3:05 pm
by diegosiassb
attached screenshots of the nagios conf

Re: Nagiosxi does not send mail via contacts

Posted: Mon Dec 28, 2020 2:21 pm
by dchurch
diegosiassb wrote: i try with my account not contact Sistemisti_linux but i think is the same
Are you able to receive both the test emails and the notification emails at the email address for nagiosadmin?

If you PM me a system profile I can diagnose further. Get one by going to Admin (top menu) => System Profile (in the left menu), then clicking the blue button.

Re: Nagiosxi does not send mail via contacts

Posted: Mon Jan 04, 2021 9:08 am
by diegosiassb
Hi
here is the configuration:

Nagios XI - System Info
System
Nagios XI version: 5.7.5
Release info: localhost.localdomain 3.10.0-1160.2.2.el7.x86_64 x86_64
CentOS Linux release 7.9.2009 (Core)
Gnome is not installed
Apache Information
PHP Version: 5.4.16
Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Server Name: 10.104.1.15
Server Address: 10.104.1.15
Server Port: 80
Date/Time
PHP Timezone: Europe/Rome
PHP Time: Mon, 04 Jan 2021 15:07:12 +0100
System Time: Mon, 04 Jan 2021 15:07:12 +0100
Nagios XI Data
License ends in: RPRNSU
UUID: d45f9eef-4401-41a4-aeb3-5049cd86a6bc
Install Type: ova

└─24307 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
└─1081 /usr/local/nagios/bin/npcd -d -f /usr/local/nagios/etc/pnp/npcd.cfg
CPU Load 15: 0.05
Total Hosts: 6
Total Services: 15

Function get_base_uri() returns: http://10.104.1.15/nagiosxi/
Function get_base_url() returns: http://10.104.1.15/nagiosxi/
Function get_backend_url(internal_call=false) returns: http://10.104.1.15/nagiosxi/includes/co ... rofile.php
Function get_backend_url(internal_call=true) returns: http://localhost/nagiosxi/backend/

Ping Test localhost
Running:
/bin/ping -c 3 localhost 2>&1
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.073 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.055 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.075 ms

--- localhost ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 0.055/0.067/0.075/0.013 ms
Test wget To localhost
WGET From URL: http://localhost/nagiosxi/includes/components/ccm/
Running:
/usr/bin/wget http://localhost/nagiosxi/includes/components/ccm/
--2021-01-04 15:07:14-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 27 [text/html]
Saving to: '/usr/local/nagiosxi/tmp/ccm_index.tmp'

0K 100% 6.89M=0s

2021-01-04 15:07:14 (6.89 MB/s) - '/usr/local/nagiosxi/tmp/ccm_index.tmp' saved [27/27]

Network Settings
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

inet 127.0.0.1/8 scope host lo

valid_lft forever preferred_lft forever

inet6 ::1/128 scope host

valid_lft forever preferred_lft forever

2: eth0: mtu 1500 qdisc mq state UP group default qlen 1000

link/ether 56:6f:31:d3:04:0f brd ff:ff:ff:ff:ff:ff

inet 10.104.1.15/24 brd 10.104.1.255 scope global noprefixroute eth0

valid_lft forever preferred_lft forever

inet6 fe80::546f:31ff:fed3:40f/64 scope link

valid_lft forever preferred_lft forever


default via 10.104.1.1 dev eth0 proto static metric 100

10.104.1.0/24 dev eth0 proto kernel scope link src 10.104.1.15 metric 100


Nagios XI Components
actions 2.2.3
alertcloud 1.2.1
alertstream 2.1.1
autodiscovery 2.2.6
backendapiurl 1.0.5
bandwidthreport 2.0.1
bbmap 1.2.1
birdseye 3.2.4
bulkmodifications 2.3.0
capacityplanning 2.3.1
ccm 3.0.8
custom-includes 1.0.6
customlogin 1.0.0
customlogo 1.2.0
deploydashboard 1.3.1
deploynotification 1.3.4
duo 1.0.2
escalationwizard 1.5.1
favorites 1.0.1
freevariabletab 1.1.0
globaleventhandler 1.3.0
graphexplorer 2.3.0
helpsystem 2.0.1
highcharts
homepagemod 1.1.11
hypermap 1.2.2
hypermap_replay 1.2.1
latestalerts 1.2.7
ldap_ad_integration 1.2.1
map 1.1.1
massacknowledge 2.2.2
massimmediatecheck 1.0.2
metrics 1.3.5
minemap 1.2.5
msp 1.2.0
mtr 1.0.3
nagiosbpi 3.0.1
nagioscore
nagioscorecfg
nagiosna 1.4.4
nagiosql
nagvis 2.0.6
nocscreen 1.4.1
nrdsconfigmanager 1.6.9
nxti 1.0.4
opscreen 1.8.0
perfdata
pingaction 1.1.2
pnp
profile 1.4.1
proxy 1.1.5
rdp 1.0.5
rename 1.7.0
scheduledbackups 1.2.0
scheduledreporting
similetimeline 1.5.1
snmptrapsender 1.6.2
statusmap 1.0.3
tracerouteaction 1.1.2
twilio 1.0.0
usermacros 1.1.0
xicore
Nagios XI Config Wizards
activedirectory 1.3.5
ec2 1.1.3
s3 1.1.2
java_tomcat 1.1.0
autodiscovery 1.4.2
bpiwizard 1.1.5
bulkhostimport 2.1.3
capacity-planning 1.0.3
dhcp 1.1.7
dnsquery 1.1.6
digitalocean 1.0.3
docker 1.1.1
domain_expiration 1.1.8
email-delivery 2.0.6
esensors_websensor 1.1.7
exchange 2.0.1
ftpserver 1.5.8
folder_watch 1.0.7
genericnetdevice 1.0.5
java_glassfish 1.1.0
google-cloud 1.0.3
hyperv 1.0.2
java_jboss 1.1.0
json 1.0.0
java_jetty 1.1.0
ldapserver 1.3.5
linode 1.0.3
linux_snmp 1.5.9
linux-server 1.5.9
mssql_database 2.0.1
mssql_query 1.6.9
mssql_server 2.0.1
macosx 2.0.0
mailserver 1.2.7
microsoft-azure 1.0.3
mongodb_database 1.1.5
mongodbserver 1.1.5
mountpoint 1.0.4
mysqlquery 1.2.5
mysqlserver 1.3.5
ncpa 3.0.4
nrpe 1.6.0
nsclient 1.0.0
nagioslogserver 1.0.8
nna 1.0.8
nagiosxiserver 1.3.3
nagiostats 1.2.3
switch 2.5.3
oraclequery 1.3.9
oracleserverspace 1.5.9
oracletablespace 1.5.10
passivecheck 1.2.6
postgresdb 1.5.5
postgresquery 1.2.5
postgresserver 1.3.6
printer 1.1.5
radiusserver 2.0.4
rackspace 1.0.3
sla 1.3.4
snmp 1.6.5
snmp_trap 1.5.5
snmpwalk 2.0.1
sshproxy 1.5.9
solaris 1.3.3
tcpudpport 1.3.5
tftp 1.0.4
passiveobject 1.1.3
vmware 1.7.4
watchguard 1.4.7
webtransaction 1.2.7
java_weblogic 1.1.0
website 1.4.2
website_defacement 1.2.2
websiteurl 1.4.1
windowsdesktop 2.0.0
windowseventlog 2.0.2
windowssnmp 1.5.7
windowsserver 2.0.0
windowswmi 2.2.2
xml 1.0.0
Nagios XI Dashlets
alertcloud
bbmap
capacityplanning
graphexplorer
hypermap
latestalerts
metrics
metricsguage
minemap
xicore_xi_news_feed
xicore_getting_started
xicore_admin_tasks
xicore_eventqueue_chart
xicore_component_status
xicore_server_stats
xicore_monitoring_stats
xicore_monitoring_perf
xicore_monitoring_process
xicore_perfdata_chart
xicore_host_status_summary
xicore_service_status_summary
xicore_comments
xicore_hostgroup_status_overview
xicore_hostgroup_status_grid
xicore_servicegroup_status_overview
xicore_servicegroup_status_grid
xicore_hostgroup_status_summary
xicore_servicegroup_status_summary
xicore_available_updates
xicore_network_outages
xicore_network_outages_summary
xicore_network_health
xicore_host_status_tac_summary
xicore_service_status_tac_summary
xicore_feature_status_tac_summary
availability
custom_dashlet 1.0.7
gauges 1.2.2
googlemapdashlet 1.1.0
internettrafficreport
rss_dashlet 1.1.5
sansrisingports 2.0
sla
worldtimeserver 2.0.0

Re: Nagiosxi does not send mail via contacts

Posted: Mon Jan 04, 2021 6:26 pm
by ssax
Did you setup the backend postfix to relay for you? (you need to if you haven't)

https://www.linode.com/docs/guides/post ... lay-server

You could also do this to make it use Admin > Email Settings SMTP settings:

https://assets.nagios.com/downloads/nag ... Mailer.pdf

The Test Email button is not a valid test for this. You'll need to do it this way:

Please go to Admin > Manage Email Settings:
- Make sure Logging is checked
- Click the Update Settings button

Then run this tail command as root (and leave it running):

Code: Select all

tail -Fn0 /var/log/maillog /usr/local/nagiosxi/tmp/phpmailer.log /usr/local/nagiosxi/var/eventman.log
Then force a notification to be sent then send me the full output of the tail command above and any errors you see on the screen (please test via the instructions below exactly).

How to submit passive results for testing:

For Hosts
------------

Go to Home > Host Status:
- Find the Host and click on it
- Click the + tab
- Click the "Submit passive check result" link
- Select the Check Result and type in some text for the Check Output
- Click the Submit button

NOTE: By default, passive_host_checks_are_soft=0 is set in your /usr/local/nagios/etc/nagios.cfg, this differs from services in that when you submit a passive host check result it immeditely goes into a HARD state (and should send a notification if configured to) instead of going into a SOFT state like services do. (notifications are only sent on HARD states).

For Services
----------------

Go to Home > Service Status:
- Find the Service and click on it
- Click the + tab
- Note these two rows:

State Type: Hard
Current Check: 1 of 4

Those columns tell the current State Type and the Current Check number. In order to generate a notification for a service you will need to submit MULTIPLE problem check results (the number that you need to submit is determined by the last number in the Current Check column, that is the max_check_attempts setting). For services, when you submit a passive check result, each result that you submit will be a SOFT state until you submit enough to hit the Max Check Attempts setting that you've defined on the service, only then will the service enter a HARD problem state which will generate the notification (just remember, notifications are only sent on HARD states).

- Click the "Submit passive check result" link
- Select the Check Result and type in some text for the Check Output
- Click the Submit button
- Submit as many as you need, right after another, until the service enters the HARD state so that a notification will be sent

NOTE: When coming from a HARD problem state (whether we are talking about hosts or services) if you submit an OK passive result it should fire off a recovery notification after a single passive result has been submitted.

Re: Nagiosxi does not send mail via contacts

Posted: Tue Jan 05, 2021 4:44 am
by diegosiassb
Thanks for your help

i have configured postfix and done some command line tests. all right.
there's one more thing I don't understand.
The log below shows a notification and sending the email everything works but .....


[root@localhost ~]# tail -Fn0 /var/log/maillog /usr/local/nagiosxi/tmp/phpmailer.log /usr/local/nagiosxi/var/eventman.log
==> /var/log/maillog <==

==> /usr/local/nagiosxi/tmp/phpmailer.log <==

==> /usr/local/nagiosxi/var/eventman.log <==...
PROCESSED 0 EVENTS
...................
PROCESSED 0 EVENTS
..................
==> /var/log/maillog <==
Jan 5 10:33:54 localhost postfix/qmgr[2166]: 58A031E13C0: from=<[email protected]>, size=767, nrcpt=1 (queue active)
Jan 5 10:33:54 localhost postfix/smtp[11225]: 58A031E13C0: to=<[email protected]>, relay=10.2.101.111[10.2.101.111]:25, delay=252159, delays=252159/0.01/0/0.04, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as DA91B2B0)
Jan 5 10:33:54 localhost postfix/qmgr[2166]: 58A031E13C0: removed

==> /usr/local/nagiosxi/var/eventman.log <==
..
PROCESSED 0 EVENTS
...................


if I do a test with one of my hosts that I entered with the wrong ip to make it alarm it does not work.
i tried to force the check from nagios but nothing does not track anything.

Re: Nagiosxi does not send mail via contacts

Posted: Tue Jan 05, 2021 4:56 am
by diegosiassb
other questions:
how do i modify [email protected] in
[email protected]? and the text of the email sent?
what are the parameters defined on the nagiosxi web page in setting mail for?


in my old nagiosxi I used my own command created that used sendmail another system but now I would like to use the one chosen by you

Thanks

Re: Nagiosxi does not send mail via contacts

Posted: Tue Jan 05, 2021 5:43 am
by diegosiassb
was sendemail

Re: Nagiosxi does not send mail via contacts

Posted: Tue Jan 05, 2021 7:47 am
by diegosiassb
I try new test and log write:

[root@nagiosxi01 ~]# tail -Fn0 /var/log/maillog /usr/local/nagiosxi/tmp/phpmailer.log /usr/local/nagiosxi/var/eventman.log
==> /var/log/maillog <==
tail: cannot open ‘/usr/local/nagiosxi/tmp/phpmailer.log’ for reading: No such file or directory

==> /usr/local/nagiosxi/var/eventman.log <==



other thing that I have noticed: hosts that have admin as group work and send mail.
while those who have only the contact I created do not send mail

Admins use generic-contact that I have configured with my email.
but I cannot use a single contact, I have to work at a higher level to have many different groups linked to the services we provide.

bye

Re: Nagiosxi does not send mail via contacts

Posted: Tue Jan 05, 2021 8:41 am
by diegosiassb
I try new test and log write:

[root@nagiosxi01 ~]# tail -Fn0 /var/log/maillog /usr/local/nagiosxi/tmp/phpmailer.log /usr/local/nagiosxi/var/eventman.log
==> /var/log/maillog <==
tail: cannot open ‘/usr/local/nagiosxi/tmp/phpmailer.log’ for reading: No such file or directory

==> /usr/local/nagiosxi/var/eventman.log <==



other thing that I have noticed: hosts that have admin as group work and send mail.
while those who have only the contact I created do not send mail

Admins use generic-contact that I have configured with my email.
but I cannot use a single contact, I have to work at a higher level to have many different groups linked to the services we provide.

bye