The following conditions are required to remotely obtain the Windows and Linux operating system versions and host names:
Assume
Host A (Windows 7), ip:192.168.12.2
Host B (CentOS 6.3), ip:192.168.12.3
Host C (Windows 2008)-a host for remote access to information, ip:192.168.12.4
Host d (CentOS 6.3)-For remote access to information for the host, ip:192.168.12.5
Windows:
1. Host A can ping through host C;
2. Host B can ping through host C;
3. Host B can communicate with host C via the SNMP protocol via 161 ports;
Linux:
1. Host B can ping through host D;
2. Host B can communicate with host D through the SNMP protocol via 161 ports;
3. The community name of host D can be obtained in some way;
4. Be sure to use Nagios before use.
Window Information Acquisition Method:
Get host name with Mac:
Execute from a
Get System Version information:
Execute from B
/usr/local/nagios/libexec/check_snmp-h 192.168.12.4-c Public-o sysname.0
/usr/local/nagios/libexec/check_snmp-h 192.168.12.4-c Public-o sysdescr.0
How to obtain Linux information:
Execute on B
/usr/local/nagios/libexec/check_snmp-h 192.168.12.5-c Public-o sysdescr.0