Monitoring the performance of the WIndows server. It is recommended to use the SNMP method, but the configuration is cumbersome. It would be more convenient to use the NSCLIENT++ plugin, provided that the plugin needs to be installed on the specific monitored server. In the unlikely event that the application that affects the server itself is not good. So, I have been looking for SNMP ways to monitor Windows servers.
1, add the script as follows:
cat /usr/lib/nagios/plugins/check_snmp_win_cpuload.pl#!/usr/bin/perl## syntax: check_win_snmp_cpuload.pl HOST COMMUNITY WARN CRIT ## returns average load % across all CPUs#
use strict;use Net::SNMP;
my $host = shift;my $community = shift;my $warn = shift;my $crit = shift;
unless($crit) {errorExit("syntax: check_win_snmp_cpu.pl HOST COMMUNITY WARN CRIT");}
our %ERRORS = (OK => 0 , WARNING => 1, CRITICAL => 2, UNKNOWN => 3, DEPENDENT => 4);
my $oidCpuTable='.1.3.6.1.2.1.25.3.3.1.2' ;
# get SNMP session objectmy ($snmp, $err) = Net::SNMP->session(-hostname => $host,-community => $community,-port => 161,-version => 1); errorExit( $err ) unless (defined($snmp));
# get cpu load tablemy $response = $snmp->get_table(-baseoid => $oidCpuTable);errorExit( "error getting cpu table" ) unless $response;my %value = %{$response};$snmp->close();
my $cnt = 0;my $sum = 0;foreach my $load ( values %value ){$cnt += 1;$sum += $load;};my $pct = int ($sum /$cnt);
my $err = ($pct > $crit) ? 'CRITICAL' : ($pct > $warn) ? 'WARNING' : 'OK';print "$err : CPU Load $pct%\ ";exit $ERRORS{$ Err};
sub errorExit {my $msg = shift;print "UNKNOWN: $msg\ ";exit $ERRORS{UNKNOWN};}
2, define the corresponding execution command :
cat mysnmp.cfgdefine command{command_name snmp_win_cpucommand_line /usr/lib/nagios/plugins/check_snmp_win_cpuload.pl '$HOSTADDRESS$' public 80 90}
3, New Service Profile: < Br>
cat service.cfgdefine service {host_name jw-insideservice_description CPUcheck_command snmp_win_cpuuse generic-service}
4, create a new host file: define host {host_name jw-insidealias jw-insideaddress 10.10.10.11use generic-hosticon_image Vendors/windowsxp.pngicon_image_alt jw-inside-servervrml_image vendors/windowsxp.pngstatusmap_image vendors/windowsxp.png }
Experimental Line Connection Diagram: DCRS-5526S Configuration: Assume that the name of the DHCP ad
Reducing keyboard input can greatly improve the productivity of programmers. The use of sho
There are five basic ways to dissipate a blade server. Once one of these methods is selected
Hyper-V Replica resynchronization This topic raises peoples attention, the first question you might
The server must know a few knowledge
Why should SMEs choose a shared infrastructure platform?
Seven free Windows server management tools
Linux FTP server security completely Raiders
Server 2003 acceleration method
Windows Server Administrator PowerShell Getting Started
Dhcp server configuration management full Raiders
Server common fault causes and troubleshooting
Key Points Affecting SQL Server Performance
Xeon processor IBM System x3500 priced at 14300
How to add a task schedule to shut down Win1
How to create a very large file in Win10
Win8 interface mouse control skills
How does Windows 7 solve software compatibility problems?
Win7 system appears win32.sys blue screen solution
How does Win7 check if localhost is normal?
Win7 boot shows how to get the network address is solved?
What are the useful functions in Win7 system
Win8 system encountered blue screen failure error code 0X00000001 reasons and solutions