Nagios HTML mail
Nagios HTML mail
Hi,
After you guys helped me with setting up the mail notification i would like to use HTML teplates ( because it looks better and is easy in use ).
Now i wanted to install the following plugin in CentOs :
http://engineering.voxer.com/2014/02/24 ... templates/
But i could not download it
After that i tryed this one :
https://github.com/jasonhancock/nagios-html-email
But i didnt recived any mail.
I also tryed this one :
http://exchange.nagios.org/directory/Ad ... v2/details
But could not find the nagios/libexec/ folder....
Is there anyone who could help me out ?
After you guys helped me with setting up the mail notification i would like to use HTML teplates ( because it looks better and is easy in use ).
Now i wanted to install the following plugin in CentOs :
http://engineering.voxer.com/2014/02/24 ... templates/
But i could not download it
After that i tryed this one :
https://github.com/jasonhancock/nagios-html-email
But i didnt recived any mail.
I also tryed this one :
http://exchange.nagios.org/directory/Ad ... v2/details
But could not find the nagios/libexec/ folder....
Is there anyone who could help me out ?
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Nagios HTML mail
Well, none of these are likely to be "plug and play" solutions, Core takes a bit of work when you want to add in solutions such as these.
For the top one you posted, you did not follow the directions... you need to use the node package manager, not yum, I suggest you re-read the instructions and try that one out first.
What distro are you on? You should have a /usr/local/nagios/libexec directory by default if you configured the plugins package on Centos/RHEL.I also tryed this one :
http://exchange.nagios.org/directory/Ad ... v2/details
But could not find the nagios/libexec/ folder....
For the top one you posted, you did not follow the directions... you need to use the node package manager, not yum, I suggest you re-read the instructions and try that one out first.
Re: Nagios HTML mail
Hi,
I installed node package manager and downloaded the plugin.
But whenn i changed the send mail code to :
I even changed to
But i wont recive mail
I found this on there website :
EDIT :
Whenn i use this code in terminal :
It makes a mail in terminal.....
But is it beause i use POSTFIX it wont send the mail?
I installed node package manager and downloaded the plugin.
But whenn i changed the send mail code to :
Code: Select all
define command {
command_name notify-service-by-email
command_line nagios-html-email service http://nagios.example.com | mailx -t
}
define command {
command_name notify-host-by-email
command_line nagios-html-email host http://nagios.example.com | mailx -t
}
Code: Select all
mailx -t
Code: Select all
postfix
I found this on there website :
But how can i check / change the path?No emails are being generated
Most likely, the path with nagios-html-email in it is not in the PATH variable for the Nagios server. Ensure the path given by which nagios-html-email is in the PATH of the Nagios server.
EDIT :
Whenn i use this code in terminal :
Code: Select all
nagios-html-email -a --myemail@mail.nl mailx -t
But is it beause i use POSTFIX it wont send the mail?
Last edited by ericosman on Wed Nov 12, 2014 4:10 am, edited 1 time in total.
Re: Nagios HTML mail
So i guess it cant find the email adresses?
Code: Select all
root@Nagios objects]# nagios-html-email service http://nagios.example.com | mailx -t
env NAGIOS_CONTACTEMAIL or `-a <address>` must be supplied!
Usage: nagios-html-email [options] <service|host> [arg1] [arg2] ...
This command is meant to be run from nagios when a service or host
experiences problems. The output will be suitable for passing to
a mail program that takes raw email data like `mailx -t`
Options
-a, --address <email> the email address to send mail to, defaults to env NAGIOS_CONTACTEMAIL
-h, --help print this message and exit
-s, --subject <subject> the email subject to use, defaults to _subject for the host/service, or default nagios subject
-t, --template-dir <dir> dir to find ejs template files, defaults to builtin templates
-u, --updates check for available updates on npm
-v, --version print the version number and exit
No message, no subject; hope that's ok
No recipients specified
"/root/dead.letter" 7/186
[root@Nagios objects]#
Re: Nagios HTML mail
Can you try running the same command again as the nagios user:
Code: Select all
su nagios
nagios-html-email service http://nagios.example.com | mailx -t
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Nagios HTML mail
Hi,abrist wrote:Can you try running the same command again as the nagios user:Code: Select all
su nagios nagios-html-email service http://nagios.example.com | mailx -t
What is the standard password?
Because i cant figure it out
Re: Nagios HTML mail
You should not need the password if you were root on the system.
Or else you could set the password with the following command:
Or else you could set the password with the following command:
Code: Select all
passwd nagios
Rob Hassing
Re: Nagios HTML mail
As mentioned, it is easiest to log in as root and then change to the nagios user:
Let us know if you have issues with the nagios account and /bin/login or nologin).
Code: Select all
su nagios
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Nagios HTML mail
Code: Select all
[administrator@Nagios root]$ su nagios
Password:
This account is currently not available.
Re: Nagios HTML mail
Code: Select all
usermod -s /bin/bash nagios
Code: Select all
sudo usermod -s /bin/bash nagios
Rob Hassing