hsmith wrote:Can you post your commands.cfg for review? Also, you need to get logged in as the user 'nagios' to try to use that mail command. If you are unable to get logged in as this user, your Linux administrator should be able to help you get in. If you need to set a password for the nagios user, the command to do that would be passwd nagios, from there you would be able to log in to the account.
contacts.cfg is not working properly
Re: contacts.cfg is not working properly
I am unsure whether or not you caught my edit on the post above, but we need to try running these commands as the user "nagios".
Former Nagios Employee.
me.
me.
Re: contacts.cfg is not working properly
during initial set up i did
i dont know the password for user nagios?
Code: Select all
sudo useradd nagios
sudo groupadd nagcmd
sudo usermod -a -G nagcmd nagiosRe: contacts.cfg is not working properly
Does the passwd nagios command not work?
Former Nagios Employee.
me.
me.
Re: contacts.cfg is not working properly
i never gave a password for nagios during initial setup.
If i change password for nagios now, all the scripts and checks running with user nagios will fail?
If i change password for nagios now, all the scripts and checks running with user nagios will fail?
Re: contacts.cfg is not working properly
It shouldn't, I have done it on my core installation without problem, but to be safe we can also use the following one-liner:
sudo su nagios -c /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: test\n\nService: test\nHost: test\nAddress: test\nState: test\n\nDate/Time: test\n\nAdditional Info:\n\test\n" | /bin/mail -s "** test Service Alert: test/test is test **" "youremail"
sudo su nagios -c /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: test\n\nService: test\nHost: test\nAddress: test\nState: test\n\nDate/Time: test\n\nAdditional Info:\n\test\n" | /bin/mail -s "** test Service Alert: test/test is test **" "youremail"
Former Nagios Employee.
me.
me.
Re: contacts.cfg is not working properly
Code: Select all
ubuntu@nagios-2015:~$ sudo su nagios -c /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: test\n\nService: test\nHost: test\nAddress: test\nState: test\n\nDate/Time: test\n\nAdditional Info:\n\test\n" | /usr/bin/mail -s "** test Service Alert: test/test is test **" "[email protected]"
Null message body; hope that's ok
ubuntu@nagios-2015:~$
Re: contacts.cfg is not working properly
I got the same output and still got the email, at my gmail address.
Former Nagios Employee.
me.
me.
Re: contacts.cfg is not working properly
i am getting to my gmail too but not to those alerts-warning or alerts 911 email address.
Re: contacts.cfg is not working properly
If you're able to send to gmail, but not the other email addresses using the command I provided it is no longer something that Nagios is doing. Now I would say it is time to look at your email server logs and see what is happening. You can explore other solutions such as using SMTP on your Nagios Core machine, but first I would look at your email server and see if it is filtering.
Former Nagios Employee.
me.
me.
Re: contacts.cfg is not working properly
i checked with system admin. no filters on email server.
nothing in mail log either.
i am getting updates sometimes from nagios to alerts-warning email but nothing to 911 email.
Code: Select all
tail -f mail.log.1
Oct 11 06:38:18 nagios-2015 postfix/cleanup[23151]: 4549A457E8: message-id=<20151011063818.4549A457E8@ip-10-0-10-149>
Oct 11 06:38:18 nagios-2015 postfix/qmgr[1306]: 4549A457E8: from=<>, size=2423, nrcpt=1 (queue active)
Oct 11 06:38:18 nagios-2015 postfix/bounce[23157]: 408E9457D6: sender non-delivery notification: 4549A457E8
Oct 11 06:38:18 nagios-2015 postfix/qmgr[1306]: 408E9457D6: removed
Oct 11 06:38:18 nagios-2015 postfix/smtp[23156]: 4549A457E8: to=<nagios@ip-10-0-10-149>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=5.4.4, status=bounced (Host or d
omain name not found. Name service error for name=ip-10-0-10-149 type=AAAA: Host not found)
Oct 11 06:38:18 nagios-2015 postfix/qmgr[1306]: 4549A457E8: removed
i am getting updates sometimes from nagios to alerts-warning email but nothing to 911 email.