Page 1 of 1

Add Linux workstation without NRPE

Posted: Thu Jan 26, 2017 12:39 pm
by nagios1_1
I would like to add a linux machine. Could you help with the various steps? Thank you

Re: Add Linux workstation without NRPE

Posted: Thu Jan 26, 2017 12:44 pm
by dwhitfield
You could do it with SNMP, but you may not get all the features you need with it: https://assets.nagios.com/downloads/nag ... ptrap.html

You can also use NSClient, even though NSClient is mostly used for Windows.

What's stopping you from using NRPE?

What version of Core are you using? Was it compiled from source or installed from distro repos? On what OS/version is nagios running? cat /etc/*-release may be of use.

Re: Add Linux workstation without NRPE

Posted: Thu Jan 26, 2017 1:06 pm
by nagios1_1
What's stopping you from using NRPE?
I want to learn how to use it from the command line.
What version of Core are you using?
I use Nagios core 4.2.4

I have created in this path /usr/local/nagios/etc/objects, linux_host.cfg and I added this path even within the file /usr/local/nagios/etc/nagios.cfg
I included in my linux_host.cfg file, this code:


# Define a host for the Windows machine we'll be monitoring
# Change the host_name, alias, and address to fit your situation

define host{
use linux-machine ; Inherit default values from a template
host_name host-Marco ; The name we're giving to this host

address 192.168.15,144 ; IP address of the host
}
Now which template should I use to test various services on the machine?

Re: Add Linux workstation without NRPE

Posted: Thu Jan 26, 2017 1:31 pm
by dwhitfield
nagios1_1 wrote: I want to learn how to use it from the command line.
I'm still a bit lost. Are you trying to learn Linux or Nagios? You can still run NRPE checks from the command line. You can compile NRPE from the command line: https://support.nagios.com/kb/article.php?id=515

Maybe I should back up a step though. Do you have the nagios plugins installed? Instructions for the plugins are at the bottom of https://support.nagios.com/kb/article.php?id=96

I'm guessing you compiled core from source given your version #. On what distro are you running Core and what distro are you looking to monitor?

Re: Add Linux workstation without NRPE

Posted: Sat Mar 04, 2017 5:38 am
by nagios1_1
Excuse me for the late reply. I want to understand how to add a new host in the main configuration file.
I edit in the main config file to tell it the location of the new config file

Code: Select all

nano /usr/local/nagios/etc/nagios.cfg
Add the following line to the file:

Code: Select all

cfg_file=/usr/local/nagios/etc/objects/iphone.cfg
Then I edit my iphone.cfg file in

Code: Select all

/usr/local/nagios/etc/objects/iphone.cfg
, but when I restart nagios, I get any errors.

I check problems with this command:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Senza titolo.jpeg

Re: Add Linux workstation without NRPE

Posted: Sun Mar 05, 2017 8:34 pm
by dwhitfield
Can you post both of those .cfg files?

Also, do you have two Core servers? Before you mentioned you were using 4.2.4, but the screenshot says 4.2.2.

Ultimately, if you are having trouble adding hosts, it doesn't matter what kind of host, but for future reference, if you have a new issue, it's best to open a new thread.