I'm totally new to Nagios I did install Nagios 4.4.6 all what I need only to check if a router or a remote Linux is alive I mean exactly like a ping and that's it so I don't think I need NRPE I don't know how to do that actually ?
I need only PING,SSH,HTTP,HTTPS for each Linux machine and SSH or PING or virtual router !!
I really need your help for the configuration on the Nagios itself because I don't think I need anything to be configured on the remote Linux or CSR from Cisco for example
That's exactly correct, yes - you wouldn't use NRPE checks for monitoring a router or other non-server device. If all you want to know is if it's up or not, you would just do a ping check. And all the work for doing this is carried out on the Nagios server, with nothing needing to be installed on your network device.
You would set up a ping check on your Nagios server by first defining the device to be checked in your hosts.cfg file, and then ensuring that you have an entry for that newly-defined device in your services.cfg file to check the host with the check_ping command. So all the work is done on the Nagios server, with nothing needing doing on your network device other than ensuring that it will accept ping requests from your Nagios server.
If you do need more information than a simple ping check for a network device such as a router, your best bet for doing that is to carry out the checks via an appropriate Nagios SNMP plugin and command. You can get all kinds of information this way on the device's interfaces, its network traffic, CPU load levels, uptime, and so on and so forth. But that can come later - first, get the hang of setting up basic checks in the manner described above, then go from there.
Hope this helps ! If not, or if you have any further questions, please let us know and we can take things from there.
Commands like check_ping are mapped to the real commands in commands.cfg.
AFAIR a host entry in hosts.cfg does an automatic invocation of the check_host command (that is usually mapped to a ping) in order to get the "host is up/down" status.
If you're getting "Connection refused" when trying to connect to your Nagios server in a Web browser, this isn't actually directly anything to do with Nagios. From your earlier post, we would have assumed you were talking about a Web server you're trying to monitor via Nagios, and that you were unable to connect to that server on port 80 from your Nagios box (and thus, as per MadeInGermany's earlier reply, the Nagios check_http command would fail for that server).
If, instead, you're meaning to tell us you can't bring up Nagios in your Web browser, that simply means that your Nagios server is not also running a Web server. Nagios is not, itself, a Web server. It can very easily integrate with one - indeed, it more or less does so out-of-the-box, typically, with a bit of manual adjustment required - but it doesn't directly listen on port 80 (or indeed any port) itself. It's a monitoring server, that purely carries out checks, and makes that information available via a CGI interface on your Web server of choice.
So, the error here means either that the Web server software isn't running on your Nagios box (whether that's Apache or something else), or the Web server is refusing your connection for some other reason (such as port 80 being firewalled, most commonly). That's where to look for this issue then - check your Web server is running, is properly configured, and that the Nagios server's configuration is being included in your Web server (check your Web server's config include path for that).
If this isn't quite what you mean, then please make another attempt at fully explaining the problem you're having, being sure to outline what server it is that you're trying to connect to, where you're trying to connect to it from, and what software is involved, then we can take things from there.
In that case then, the situation is just exactly as previously advised by MadeInGermany - your Nagios server cannot connect to TCP port 80 on the Web server it is attempting to monitor. Try connecting manually from the Nagios server yourself and see what you get. Check the logs on the Web server and see what might be going on. But if the connection on port 80 is being refused, that fundamentally means one of two things: either the Web server isn't accepting connections on port 80 for whatever reason; or it is explicitly rejecting connections from the Nagios server for some reason.
As I recall, the web-based user interface for Nagios is a web application, not a web server; and so configuring the Nagios web interface (for the user) is the same as configuring any other web application.
I poked around a bit, and that does seem to be the case (still), or at least it was.
See, for example:
The last time I installed Nagios (which was a very long time ago), I accessed the web UI by configuring a virtual host (on Apache2) and pointed that virtual host and the Nagios install directory. This is the same idea in the blog link above.
Admittedly, I have not done this in while, but I don't recall the Nagio web UI running as a "web server" but running as an application for a web server like Apache or Nginx; and that blog post above is 11 years old, which is about the same time as I last installed Nagios, or longer!
Please note @Zurattos , monitoring a web server is not the same as accessing the Nagios web admin UI. It's not really clear to me what you are doing. Are you trying to monitor a web server using the Nagios agents (plugins) or are you trying to access the Nagios web admin UI?
See also:
See also:
And also, see:
In the last blog post above, you can see that, in the config example above, the Nagios admin UI is a web application, served by the Apache2 web server: