Page 1 of 5

Email notification and services issue

Posted: Wed Mar 04, 2020 3:40 pm
by mhossain
Hi Team,

I have installed the trial version of Nagios xi. I also added the hosts on server. Now I am facing two issues.
Email notification is not working. All the servers are not discovering the all services. Some of the servers are only discovered the ping service and no other services.

Would appreciate your support to fix it.

Thanks
Sazzad

Re: Email notification and services issue

Posted: Thu Mar 05, 2020 1:03 pm
by jdunitz
Hello, Sazzad! We're glad to hear that you're giving Nagios a try!

First, let's find out more about your environment and what hosts you want to monitor.

Are your hosts Windows machines, Linux machines, or a mix of both (and perhaps some others as well)?

How did you go about adding your hosts? Did you them one by one with the config wizards, or did you auto-discover them?

Also, is it possible that something like a firewall or other security measures on your individual hosts might be blocking Nagios from reaching the services you want to monitor?

Whatever you can tell us will help to point you in the right direction.

Thanks!

--Jeffrey

Re: Email notification and services issue

Posted: Fri Mar 06, 2020 8:50 am
by mhossain
Hi Jeffrey,

The mail issue has been resolved after configuring the SMTP.

The hosts adding issue has been resolved. We have mixed Windows and Linux. Facing an issue to install ncpa on Ubuntu server, attached screen shot for your reference. That would be great help if you can advise install the ncpa on Ubuntu with the dependencies.


Thanks
Sazzad

Re: Email notification and services issue

Posted: Fri Mar 06, 2020 10:43 am
by jdunitz
The best way to install on ubuntu is to add the Nagios repo, download the ncpa package, and let apt deal with the dependencies, like so:

Add the following into /etc/apt/sources.list.d/nagios.list:

Code: Select all

deb https://repo.nagios.com/deb/bionic /
You could do that as a one-shot command:

Code: Select all

 echo "deb https://repo.nagios.com/deb/bionic /" > /etc/apt/sources.list.d/nagios.list
Add the Nagios public GPG key:

Code: Select all

 wget -qO - https://repo.nagios.com/GPG-KEY-NAGIOS-V2 | apt-key add -
Update your repos:

Code: Select all

 apt-get update

Once the repo has been added to apt, just install NCPA with the apt-get command:

Code: Select all

 apt-get install ncpa
This should work without issues, HOWEVER, if you're trying to do this on Ubuntu 19, you'll run into an unresolved library problem. Are you running 18 or 19?

Re: Email notification and services issue

Posted: Mon Mar 09, 2020 7:44 am
by mhossain
Thanks for your response and instruction. We are using Ubuntu 16. I am not very much familiar in Linux. I was trying to follow your instruction but it gives an error "bash: /etc/apt/sources.list.d/nagios.list: Permission denied". I have noticed that Nagios.list file is not available in /etc/apt/sources.list.d directory

Do we need to install anything on agent machine before run this command? Would appreciate your help on this.

Thanks
Sazzad

Re: Email notification and services issue

Posted: Mon Mar 09, 2020 11:22 am
by jdunitz
"bash: /etc/apt/sources.list.d/nagios.list: Permission denied". I have noticed that Nagios.list file is not available in /etc/apt/sources.list.d directory
This is because you'd need to be doing that as root. You need admin privileges to write to any files in /etc.
However, you shouldn't actually need to add that repository in Ubuntu 16, so you can skip that step in your case.
[As a side note, the bionic repository I pointed you to is for Ubuntu 18; for 16 you'd have wanted xenial. But you don't need either one in your case...]

Just try this:

Code: Select all

sudo apt install ncpa-latest.i386.deb
Note two things:
1) This time I didn't say "apt-get install", but rather just "apt install", which will install from a local package.
2) Be sure you're doing this from the directory where your ncpa package is downloaded to (I assume that's what you were doing in your screenshot).


Let me know how this goes!

Re: Email notification and services issue

Posted: Mon Mar 09, 2020 12:14 pm
by mhossain
Hi

I was able to installed the ncpa using the following commands.

wget https://assets.nagios.com/downloads/ncp ... .amd64.deb
sudo dpkg -i ./ncpa-latest.amd64.deb

After that I have checked the line "community_string = mytoken" and I kept it default.

Then restart the service using below command. I have checked the ncap.listener service status and it is running.
sudo systemctl restart ncpa_listener.service

But when I try to add this agent I receive the attached error.

Would appreciate your help to fix this issue.

Thanks
Sazzad

Re: Email notification and services issue

Posted: Mon Mar 09, 2020 12:45 pm
by mhossain
jdunitz wrote:
"bash: /etc/apt/sources.list.d/nagios.list: Permission denied". I have noticed that Nagios.list file is not available in /etc/apt/sources.list.d directory
Just try this:

Code: Select all

sudo apt install ncpa-latest.i386.deb
Let me know how this goes!
I was able to install and configure the ncpa but now I can't add this agent from Nagios. I have shared the screen shot of the error on my previous post for your reference.

Re: Email notification and services issue

Posted: Mon Mar 09, 2020 1:56 pm
by jdunitz
Can you verify with the following commands that your NCPA agent is running, and that it's listening on port 5693?

Code: Select all

my-ubuntu$ ps waux | grep ncpa
nagios    3953  0.0  3.1 234932 32016 ?        Sl   09:35   0:00 /usr/local/ncp /ncpa_listener --start
nagios    3959  0.0  3.0 161140 31500 ?        S    09:35   0:01 /usr/local/ncp /ncpa_passive --start
mrguy     5954  0.0  0.1  21292  1084 pts/17   S+   13:50   0:00 grep --color=auto ncpa
my-ubuntu$ netstat -a | grep 5693
tcp6       0      0 [::]:5693               [::]:*                  LISTEN
my-ubuntu$
Also, make sure the start message shows up in your syslog:

Code: Select all

my-ubuntu$ sudo grep ncpa /var/log/syslog
Mar  9 09:35:21 mrguy-virtual-machine ncpa_listener[3933]: Started NCPA Listener
Mar  9 09:35:22 mrguy-virtual-machine ncpa_passive[3949]: Started NCPA Passive
my-ubuntu$
Let me know what you discover. Thanks!

--Jeffrey

Re: Email notification and services issue

Posted: Mon Mar 09, 2020 3:03 pm
by mhossain
Hi Jeffrey,

Attached please find the screenshot if I execute the commands.

Thanks
Sazzad