Nagios e-mail notifications on RPi
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have a PC on my network that I want to monitor with a simple periodic ping from a Raspberry Pi. I'm totally new to the RPi and Linux and this seemingly simple project is turning into a massive headache. However, I've made massive progress in installing Nagios PI on the RPi and configuring it to monitor my PC with a periodic ping via NConf. So within the Nagios GUI I can see when my PC is up and down (this took 2 days to get this far). I also setup e-mail on the RPi using sSMTP and I can send e-mails from the command line (this took another long day).
So all I now need to do is get Nagios/NConf to send me an e-mail when it sees my PC is down. Unfortunately, this is where my luck or talent (or both!) have run out. Can anyone help point me in the right direction to get these e-mail notifications working within Nagios/NConf please?
Any ideas greatly appreciated!
Cheers
Simon
nagios
add a comment |Â
up vote
0
down vote
favorite
I have a PC on my network that I want to monitor with a simple periodic ping from a Raspberry Pi. I'm totally new to the RPi and Linux and this seemingly simple project is turning into a massive headache. However, I've made massive progress in installing Nagios PI on the RPi and configuring it to monitor my PC with a periodic ping via NConf. So within the Nagios GUI I can see when my PC is up and down (this took 2 days to get this far). I also setup e-mail on the RPi using sSMTP and I can send e-mails from the command line (this took another long day).
So all I now need to do is get Nagios/NConf to send me an e-mail when it sees my PC is down. Unfortunately, this is where my luck or talent (or both!) have run out. Can anyone help point me in the right direction to get these e-mail notifications working within Nagios/NConf please?
Any ideas greatly appreciated!
Cheers
Simon
nagios
1
If not for a learning experience, monitoring a PC with Nagios seems like using a cannon to kill a flea.
â Rui F Ribeiro
Jan 30 at 19:08
sure it starts out with "just one e-mail" but then 10,000 emails later nagios is all like why don't you talk to me any more?
â thrig
Jan 30 at 19:14
Oh dear, I had no idea. What would you recommend to run on the RPi that will notify me once when my PC is down then>?
â AnimalHungry
Jan 30 at 19:26
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a PC on my network that I want to monitor with a simple periodic ping from a Raspberry Pi. I'm totally new to the RPi and Linux and this seemingly simple project is turning into a massive headache. However, I've made massive progress in installing Nagios PI on the RPi and configuring it to monitor my PC with a periodic ping via NConf. So within the Nagios GUI I can see when my PC is up and down (this took 2 days to get this far). I also setup e-mail on the RPi using sSMTP and I can send e-mails from the command line (this took another long day).
So all I now need to do is get Nagios/NConf to send me an e-mail when it sees my PC is down. Unfortunately, this is where my luck or talent (or both!) have run out. Can anyone help point me in the right direction to get these e-mail notifications working within Nagios/NConf please?
Any ideas greatly appreciated!
Cheers
Simon
nagios
I have a PC on my network that I want to monitor with a simple periodic ping from a Raspberry Pi. I'm totally new to the RPi and Linux and this seemingly simple project is turning into a massive headache. However, I've made massive progress in installing Nagios PI on the RPi and configuring it to monitor my PC with a periodic ping via NConf. So within the Nagios GUI I can see when my PC is up and down (this took 2 days to get this far). I also setup e-mail on the RPi using sSMTP and I can send e-mails from the command line (this took another long day).
So all I now need to do is get Nagios/NConf to send me an e-mail when it sees my PC is down. Unfortunately, this is where my luck or talent (or both!) have run out. Can anyone help point me in the right direction to get these e-mail notifications working within Nagios/NConf please?
Any ideas greatly appreciated!
Cheers
Simon
nagios
asked Jan 30 at 18:39
AnimalHungry
1
1
1
If not for a learning experience, monitoring a PC with Nagios seems like using a cannon to kill a flea.
â Rui F Ribeiro
Jan 30 at 19:08
sure it starts out with "just one e-mail" but then 10,000 emails later nagios is all like why don't you talk to me any more?
â thrig
Jan 30 at 19:14
Oh dear, I had no idea. What would you recommend to run on the RPi that will notify me once when my PC is down then>?
â AnimalHungry
Jan 30 at 19:26
add a comment |Â
1
If not for a learning experience, monitoring a PC with Nagios seems like using a cannon to kill a flea.
â Rui F Ribeiro
Jan 30 at 19:08
sure it starts out with "just one e-mail" but then 10,000 emails later nagios is all like why don't you talk to me any more?
â thrig
Jan 30 at 19:14
Oh dear, I had no idea. What would you recommend to run on the RPi that will notify me once when my PC is down then>?
â AnimalHungry
Jan 30 at 19:26
1
1
If not for a learning experience, monitoring a PC with Nagios seems like using a cannon to kill a flea.
â Rui F Ribeiro
Jan 30 at 19:08
If not for a learning experience, monitoring a PC with Nagios seems like using a cannon to kill a flea.
â Rui F Ribeiro
Jan 30 at 19:08
sure it starts out with "just one e-mail" but then 10,000 emails later nagios is all like why don't you talk to me any more?
â thrig
Jan 30 at 19:14
sure it starts out with "just one e-mail" but then 10,000 emails later nagios is all like why don't you talk to me any more?
â thrig
Jan 30 at 19:14
Oh dear, I had no idea. What would you recommend to run on the RPi that will notify me once when my PC is down then>?
â AnimalHungry
Jan 30 at 19:26
Oh dear, I had no idea. What would you recommend to run on the RPi that will notify me once when my PC is down then>?
â AnimalHungry
Jan 30 at 19:26
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
Nagios uses contact
definitions that must be linked to the host
or other such monitoring bit. The contact
could be placed in in contacts.cfg
or some other configuration file, depending on how you want to manage things:
define contact
contact_name foobar
alias admin of something
email fixmeyouremailhere@example.net
host_notification_commands notify-host-by-email
host_notification_options d,u,r
host_notification_period 24x7
service_notification_commands notify-service-by-email
service_notification_options w,u,c,r
service_notification_period 24x7
And then in your host
definition reference the contact
:
define host
host_name ...
...
contacts foobar
And then restart nagios, fix any errors, etc.
Thanks! I have contacts_nagio2.cfg in the etc/nagio3/conf.d directory which now looks like this: define contact contact_name root alias Root email simon@mydomain.com host_notification_commands notify-host-by-email host_notification_options d,r host_notification_period 24x7 service_notification_commands notify-service-by-email service_notification_options w,u,c,r service_notification_period 24x7
â AnimalHungry
Jan 30 at 23:00
I didnâÂÂt include the âÂÂuâ option in host_notification_options as I only want to know when the PC goes down, and not when itâÂÂs back online. I donâÂÂt know whether I need to change the contact_name and alias so I left it as default. Then I donâÂÂt have a file called hosts, but I have one called localhost_nagios2.cfg. But in there I only have three âÂÂdefine serviceâ sections. Which file is the host definition in? Thanks again! Simon
â AnimalHungry
Jan 30 at 23:00
Nagios probably includes any*.cfg
file in the/etc/nagio3/conf.d
directory automatically, so you likely should create a newhosts.cfg
in that directory to hold your host definitions.
â thrig
Jan 30 at 23:13
Thanks again. I tried that and it still doesn't work. I'm afraid I've spent four days trying to get this to work and I've now run out of time I can spend on it right now. Thanks for trying!
â AnimalHungry
Jan 31 at 2:11
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Nagios uses contact
definitions that must be linked to the host
or other such monitoring bit. The contact
could be placed in in contacts.cfg
or some other configuration file, depending on how you want to manage things:
define contact
contact_name foobar
alias admin of something
email fixmeyouremailhere@example.net
host_notification_commands notify-host-by-email
host_notification_options d,u,r
host_notification_period 24x7
service_notification_commands notify-service-by-email
service_notification_options w,u,c,r
service_notification_period 24x7
And then in your host
definition reference the contact
:
define host
host_name ...
...
contacts foobar
And then restart nagios, fix any errors, etc.
Thanks! I have contacts_nagio2.cfg in the etc/nagio3/conf.d directory which now looks like this: define contact contact_name root alias Root email simon@mydomain.com host_notification_commands notify-host-by-email host_notification_options d,r host_notification_period 24x7 service_notification_commands notify-service-by-email service_notification_options w,u,c,r service_notification_period 24x7
â AnimalHungry
Jan 30 at 23:00
I didnâÂÂt include the âÂÂuâ option in host_notification_options as I only want to know when the PC goes down, and not when itâÂÂs back online. I donâÂÂt know whether I need to change the contact_name and alias so I left it as default. Then I donâÂÂt have a file called hosts, but I have one called localhost_nagios2.cfg. But in there I only have three âÂÂdefine serviceâ sections. Which file is the host definition in? Thanks again! Simon
â AnimalHungry
Jan 30 at 23:00
Nagios probably includes any*.cfg
file in the/etc/nagio3/conf.d
directory automatically, so you likely should create a newhosts.cfg
in that directory to hold your host definitions.
â thrig
Jan 30 at 23:13
Thanks again. I tried that and it still doesn't work. I'm afraid I've spent four days trying to get this to work and I've now run out of time I can spend on it right now. Thanks for trying!
â AnimalHungry
Jan 31 at 2:11
add a comment |Â
up vote
0
down vote
Nagios uses contact
definitions that must be linked to the host
or other such monitoring bit. The contact
could be placed in in contacts.cfg
or some other configuration file, depending on how you want to manage things:
define contact
contact_name foobar
alias admin of something
email fixmeyouremailhere@example.net
host_notification_commands notify-host-by-email
host_notification_options d,u,r
host_notification_period 24x7
service_notification_commands notify-service-by-email
service_notification_options w,u,c,r
service_notification_period 24x7
And then in your host
definition reference the contact
:
define host
host_name ...
...
contacts foobar
And then restart nagios, fix any errors, etc.
Thanks! I have contacts_nagio2.cfg in the etc/nagio3/conf.d directory which now looks like this: define contact contact_name root alias Root email simon@mydomain.com host_notification_commands notify-host-by-email host_notification_options d,r host_notification_period 24x7 service_notification_commands notify-service-by-email service_notification_options w,u,c,r service_notification_period 24x7
â AnimalHungry
Jan 30 at 23:00
I didnâÂÂt include the âÂÂuâ option in host_notification_options as I only want to know when the PC goes down, and not when itâÂÂs back online. I donâÂÂt know whether I need to change the contact_name and alias so I left it as default. Then I donâÂÂt have a file called hosts, but I have one called localhost_nagios2.cfg. But in there I only have three âÂÂdefine serviceâ sections. Which file is the host definition in? Thanks again! Simon
â AnimalHungry
Jan 30 at 23:00
Nagios probably includes any*.cfg
file in the/etc/nagio3/conf.d
directory automatically, so you likely should create a newhosts.cfg
in that directory to hold your host definitions.
â thrig
Jan 30 at 23:13
Thanks again. I tried that and it still doesn't work. I'm afraid I've spent four days trying to get this to work and I've now run out of time I can spend on it right now. Thanks for trying!
â AnimalHungry
Jan 31 at 2:11
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Nagios uses contact
definitions that must be linked to the host
or other such monitoring bit. The contact
could be placed in in contacts.cfg
or some other configuration file, depending on how you want to manage things:
define contact
contact_name foobar
alias admin of something
email fixmeyouremailhere@example.net
host_notification_commands notify-host-by-email
host_notification_options d,u,r
host_notification_period 24x7
service_notification_commands notify-service-by-email
service_notification_options w,u,c,r
service_notification_period 24x7
And then in your host
definition reference the contact
:
define host
host_name ...
...
contacts foobar
And then restart nagios, fix any errors, etc.
Nagios uses contact
definitions that must be linked to the host
or other such monitoring bit. The contact
could be placed in in contacts.cfg
or some other configuration file, depending on how you want to manage things:
define contact
contact_name foobar
alias admin of something
email fixmeyouremailhere@example.net
host_notification_commands notify-host-by-email
host_notification_options d,u,r
host_notification_period 24x7
service_notification_commands notify-service-by-email
service_notification_options w,u,c,r
service_notification_period 24x7
And then in your host
definition reference the contact
:
define host
host_name ...
...
contacts foobar
And then restart nagios, fix any errors, etc.
answered Jan 30 at 19:37
thrig
22.3k12852
22.3k12852
Thanks! I have contacts_nagio2.cfg in the etc/nagio3/conf.d directory which now looks like this: define contact contact_name root alias Root email simon@mydomain.com host_notification_commands notify-host-by-email host_notification_options d,r host_notification_period 24x7 service_notification_commands notify-service-by-email service_notification_options w,u,c,r service_notification_period 24x7
â AnimalHungry
Jan 30 at 23:00
I didnâÂÂt include the âÂÂuâ option in host_notification_options as I only want to know when the PC goes down, and not when itâÂÂs back online. I donâÂÂt know whether I need to change the contact_name and alias so I left it as default. Then I donâÂÂt have a file called hosts, but I have one called localhost_nagios2.cfg. But in there I only have three âÂÂdefine serviceâ sections. Which file is the host definition in? Thanks again! Simon
â AnimalHungry
Jan 30 at 23:00
Nagios probably includes any*.cfg
file in the/etc/nagio3/conf.d
directory automatically, so you likely should create a newhosts.cfg
in that directory to hold your host definitions.
â thrig
Jan 30 at 23:13
Thanks again. I tried that and it still doesn't work. I'm afraid I've spent four days trying to get this to work and I've now run out of time I can spend on it right now. Thanks for trying!
â AnimalHungry
Jan 31 at 2:11
add a comment |Â
Thanks! I have contacts_nagio2.cfg in the etc/nagio3/conf.d directory which now looks like this: define contact contact_name root alias Root email simon@mydomain.com host_notification_commands notify-host-by-email host_notification_options d,r host_notification_period 24x7 service_notification_commands notify-service-by-email service_notification_options w,u,c,r service_notification_period 24x7
â AnimalHungry
Jan 30 at 23:00
I didnâÂÂt include the âÂÂuâ option in host_notification_options as I only want to know when the PC goes down, and not when itâÂÂs back online. I donâÂÂt know whether I need to change the contact_name and alias so I left it as default. Then I donâÂÂt have a file called hosts, but I have one called localhost_nagios2.cfg. But in there I only have three âÂÂdefine serviceâ sections. Which file is the host definition in? Thanks again! Simon
â AnimalHungry
Jan 30 at 23:00
Nagios probably includes any*.cfg
file in the/etc/nagio3/conf.d
directory automatically, so you likely should create a newhosts.cfg
in that directory to hold your host definitions.
â thrig
Jan 30 at 23:13
Thanks again. I tried that and it still doesn't work. I'm afraid I've spent four days trying to get this to work and I've now run out of time I can spend on it right now. Thanks for trying!
â AnimalHungry
Jan 31 at 2:11
Thanks! I have contacts_nagio2.cfg in the etc/nagio3/conf.d directory which now looks like this: define contact contact_name root alias Root email simon@mydomain.com host_notification_commands notify-host-by-email host_notification_options d,r host_notification_period 24x7 service_notification_commands notify-service-by-email service_notification_options w,u,c,r service_notification_period 24x7
â AnimalHungry
Jan 30 at 23:00
Thanks! I have contacts_nagio2.cfg in the etc/nagio3/conf.d directory which now looks like this: define contact contact_name root alias Root email simon@mydomain.com host_notification_commands notify-host-by-email host_notification_options d,r host_notification_period 24x7 service_notification_commands notify-service-by-email service_notification_options w,u,c,r service_notification_period 24x7
â AnimalHungry
Jan 30 at 23:00
I didnâÂÂt include the âÂÂuâ option in host_notification_options as I only want to know when the PC goes down, and not when itâÂÂs back online. I donâÂÂt know whether I need to change the contact_name and alias so I left it as default. Then I donâÂÂt have a file called hosts, but I have one called localhost_nagios2.cfg. But in there I only have three âÂÂdefine serviceâ sections. Which file is the host definition in? Thanks again! Simon
â AnimalHungry
Jan 30 at 23:00
I didnâÂÂt include the âÂÂuâ option in host_notification_options as I only want to know when the PC goes down, and not when itâÂÂs back online. I donâÂÂt know whether I need to change the contact_name and alias so I left it as default. Then I donâÂÂt have a file called hosts, but I have one called localhost_nagios2.cfg. But in there I only have three âÂÂdefine serviceâ sections. Which file is the host definition in? Thanks again! Simon
â AnimalHungry
Jan 30 at 23:00
Nagios probably includes any
*.cfg
file in the /etc/nagio3/conf.d
directory automatically, so you likely should create a new hosts.cfg
in that directory to hold your host definitions.â thrig
Jan 30 at 23:13
Nagios probably includes any
*.cfg
file in the /etc/nagio3/conf.d
directory automatically, so you likely should create a new hosts.cfg
in that directory to hold your host definitions.â thrig
Jan 30 at 23:13
Thanks again. I tried that and it still doesn't work. I'm afraid I've spent four days trying to get this to work and I've now run out of time I can spend on it right now. Thanks for trying!
â AnimalHungry
Jan 31 at 2:11
Thanks again. I tried that and it still doesn't work. I'm afraid I've spent four days trying to get this to work and I've now run out of time I can spend on it right now. Thanks for trying!
â AnimalHungry
Jan 31 at 2:11
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f420760%2fnagios-e-mail-notifications-on-rpi%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
If not for a learning experience, monitoring a PC with Nagios seems like using a cannon to kill a flea.
â Rui F Ribeiro
Jan 30 at 19:08
sure it starts out with "just one e-mail" but then 10,000 emails later nagios is all like why don't you talk to me any more?
â thrig
Jan 30 at 19:14
Oh dear, I had no idea. What would you recommend to run on the RPi that will notify me once when my PC is down then>?
â AnimalHungry
Jan 30 at 19:26