-1

I wanted to know how to configure SNMP to monitor a servers connection to a gateway:

I have a server at location A running an SNMP monitoring software I have another server at Location B running my companies services

Is it possible to have an SNMP command that is run on Server A to check Server Bs connection to a gateway, like a ping command to 8.8.8.8

For example, running a command like:

[Server A%] snmpwalk -c community -v 1 Server.B.IP.Address  1.3.6.1.4.etc.etc.ping.8.8.8.8

Both Servers are running CentOS 6.

MadHatter
  • 79,770
  • 20
  • 184
  • 232
DateMike
  • 1
  • 1

1 Answers1

1

You have several problems with this setup.

Firstly, there is no generally-valid way to run arbitrary commands on a remote server via SNMP (thank God). That doesn't mean you couldn't define some corner of the OID space and implement your own agent, which runs pings on request, and reports back. But you'll still run into the other problems.

Secondly, PINGability is no guarantee of usability as a route; some routers don't respond to ICMP echo-request, though if yours does, this won't apply.

Thirdly, and this is the fatal one in my view, you've said the two servers (monitoring and monitored) are on different subnets. So if server B's default route is unavailable to it, how are the SNMP responses going to get to server A? You're setting up a monitoring system to test for a given condition, in a manner that is guaranteed to fail when the condition applies, and that's not a great idea.

I think you'd do better to work out what you actually want to know, and test for that. If it's (say) "can server B be reached on port 80", test for that. If it's "is server B's web application accessible and working correctly", test for that; a properly-written canary page can be very useful here. If it really is "can server B connect to the internet", you'll need a reliable backchannel on server B (ie, using the internet connection you're testing won't do), or server B should test and report on this itself via an out-of-band backchannel, eg direct-attach GSM modem. This last will be expensive and complex, so be very sure that you really do have a business need to know that before you commit to monitoring it.

MadHatter
  • 79,770
  • 20
  • 184
  • 232
  • Hi MadHatter, Thanks for the response, I apologise, maybe I should input some more information in to this question: – DateMike May 19 '17 at 07:52
  • *edit* Hi MadHatter, Thanks for the response, I apologise, maybe I should input some more information in to this question: Server A running the SNMP software is currently monitoring Server B via SNMP (Host Resources, HP iLO and other software). The link between these servers is an IP tunnel between two routers connected to each server. I used 8.8.8.8 as an example, I would need to check Server Bs connection to default gateways of a Seacom Link/ISP Link/Trunk Link, preferably by a means similar to that of a ping test. – DateMike May 19 '17 at 07:58
  • I would then need to display this successful or unsuccessful test on the SNMP monitoring software on Server A. I hope this information helps – DateMike May 19 '17 at 07:59
  • Simply restating your problem while naming the equipment doesn't convince me that you have either read or tried to understand my answer. Let me be extremely clear about problem three: **you cannot use server B's default internet connection to check whether server B's default internet connection is working**. If you really need to know that, and I currently am not convinced that you have a *business* need for it, you will need a second out-of-band monitoring connection. – MadHatter May 19 '17 at 08:43
  • Hi Madhatter, I have spoken to the team in charge of server B and they have told me that the three connections they want monitored are not one of the default internet connections – DateMike May 19 '17 at 08:53
  • OK, that makes things a bit better. Now you only have problems one, and possibly, two. Are any other mechanisms besides SNMP available to you? NRPE (which is part of NAGIOS) perhaps? – MadHatter May 19 '17 at 09:29
  • I wouldn't be too sure on the NRPE, I know the monitoring software supports: SNMP, Bacnet, IPMI, HTTP/XML, Modbus as well as other brand specific protocls: BMS(IBM), Intel, Netbotz – DateMike May 19 '17 at 10:03
  • Hi MadHatter, if I installed Nagios Network analyzer on Server B, could i then program it to run pings and send Traps to Server A? – DateMike May 19 '17 at 10:15
  • If you installed NAGIOS on server A and the NRPE agent on server B, A could ask B to run the pings and return the results. – MadHatter May 19 '17 at 11:32