使用Zabbix通过BMC管理口监控HP服务器
概述
本文的环境:Zabbix版本为3.4,一台Server,一台Porxy,一台agent。Porxy主动抓取agent的状态并sender到Server。
首先需要保证服务器的BMC口能够联网,并且拥有管理用户和密码,Proxy和agent能够保持联网。本文只针对HP系列服务器,其他品牌服务器后续更新。
安装
首先安装所需的软件包
yum install perl-IO-Socket-SSL.noarch
perl-XML-Simple.noarch perl-Class-Accessor perl-Config-Tiny.noarch perl-Monitoring-Plugin
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
脚本的代码我贴在文末,脚本存放在/root下,无需修改其内容,文件名保存为hp.pl,权限保持为-rw-r--r-- 即可。
执行脚本
perl /root/check_ilo2_health.pl -u Admin -p aliyun -3 -v -t 60 -H 192.168.1.1
选项:
-u 用户名
-p 密码
-v 版本
-t 超时时间,单位为s
-H 主机BMC管理IP
返回以下内容:(截取部分风扇)
<ZONE VALUE = "System"/><LABEL VALUE = "Fan 1"/><STATUS VALUE = "Not Installed"/><SPEED VALUE = "0" UNIT="Percentage"/></FAN><FAN><ZONE VALUE = "System"/><LABEL VALUE = "Fan 2"/><STATUS VALUE = "Not Installed"/>
chunk: 1ff
chunk size: 511<SPEED VALUE = "0" UNIT="Percentage"/></FAN><FAN><ZONE VALUE = "System"/><LABEL VALUE = "Fan 3"/><STATUS VALUE = "OK"/><SPEED VALUE = "27" UNIT="Percentage"/></FAN><FAN><ZONE VALUE = "System"/><LABEL VALUE = "Fan 4"/>
这里可以看到,可以抓取到风扇的序号和运行状态,当前状态为“Not Installed”和“OK”,我们可以通过grep和awk进行过滤,筛选需要的信息。
这时可以写一个脚本,脚本内容如下:
#!/bin/bash
LSI_LOG=/tmp/hp.log
perl /root/check_ilo2_health.pl -u administrator -p aliyun -3 -v -t 60 -H 192.168.1.1 >$LSI_LOG
cat $LSI_LOG | grep -v "^chunk" |grep -A 2 "Fan [1-9]" |grep "STATUS VALUE" |sed -e 's/"/ /g' | awk -F "/" '{print $1}' | awk -F "=" '{print $2}'
得到以下内容 Not Installed Not Installed OK OK Not Installed OK OK OK
这时就可以写一个循环,将其推送到server上,代码如下:
Sender的用法:
-z 主机IP
-s Zabbix上的主机名
-k Zabbix监控项的Key值
-o 数值,key值的数值
#!/bin/bash
LSI_LOG="/tmp/hp.log"
perl /root/hp.pl -u Administrator -p ****** -3 -v -t 60 -H 192.168.1.11 >$LSI_LOG
#get Fan state
n=1
s=1
cat $LSI_LOG | grep -v "^chunk" |grep -A 2 "Fan [1-9]" |grep "STATUS VALUE" |sed -e 's/"/ /g' | awk -F "/" '{print $1}' | awk -F "=" '{print $2}' > $LSI_LOG.temp
while read line
do
/usr/bin/zabbix_sender -z 192.168.1.10 -s hp01 -k fan"$n".state -o "$line"
((n++))
if [ $n == 13 ];then
n=1
fi
done <$LSI_LOG.temp
脚本保存在/usr/lib/zabbix/externalscripts/hp.sh
创建定时任务,crontab -e ,每五分钟执行一次
*/5 * * * * /usr/lib/zabbix/externalscripts/hp.sh >/dev/null 2>&1
此时在Zabbix添加相应的监控项以及Key值就可以了,需要注意的是,脚本Sender的-s参数(主机名字)一定要和Zabbix的主机名字对应,否则将无法获取数据。
查看最新值
创建相应触发器即可。脚本内容
#!/usr/bin/perl
# icinga: -epn# check_ilo2_health.pl
# based on check_stuff.pl and locfg.pl
#
# Nagios plugin using the Nagios::Plugin module and the
# HP Lights-Out XML PERL Scripting Sample from
# ftp://ftp.hp.com/pub/softlib2/software1/pubsw-linux/p391992567/v60711/linux-LOsamplescripts3.00.0-2.tgz
# checks if all sensors are ok, returns warning on high temperatures and
# fan failures and critical on overall health failure
#
# Alexander Greiner-Baer <alexander.greiner-baer@web.de> 2007 - 2018
# Matthew Stier <Matthew.Stier@us.fujitsu.com> 2011
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
# Changelog:
# 1.62 Mon, 14 May 2018 19:05:22 +0200
# retrieve firmware infos only when using --getinfos
# 1.61 Thu, 01 Jun 2017 20:05:04 +0200
# fix for iLO4 2.50 link state when using --ignorelinkdown
# 1.60 Wed, 12 Aug 2015 18:20:13 +0200
# provide --sslopts to override defaults settings
# fix }; for GET_EVENT_LOG
# applied patch from Rene Koch <rene.koch@siedl.net>:
# handle missing values when using "-g"
# CONTROLLER_STATUS not present on iLO4 anymore, use STATUS instead
# put SSL_VERIFY_NONE in ''
# 1.59 Wed, 28 Jan 2015 18:56:26 +0100
# fix chunk size handling
# corrected HTTP/1.1 HOST Header
# applied patch from Max Winterstein <winterstein@siriusonline.de>:
# sslv3 support
# add retries option
# catch XMLin() errors
# applied patch from Rene Koch <rene.koch@siedl.net>:
# ignore battery not installed status (option "-x")
# display server name (option "-g")
# added warning for logical drive status "Degraded (Recovering)"
# display system details (hardware model, serial number, SystemROM, iLO version)
# display memory size and part number in case of memory failure
# display hard disk model number in case of hard disk failure
# display power supply part number in case of power supply failure
# 1.58 Thu, 08 Aug 2013 18:17:02 +0200
# ignore network link down status (option "-i")
# added ENCLOSURE_ADDR to drive bay label (bay numbering was inconsistent)
# ignore spare drives
# 1.57 Fri, 17 May 2013 19:30:48 +0200
# SSL_verify_mode SSL_VERIFY_NONE (IO::Socket::SSL changed default)
# event log support for ilo2
# disable embedded perl in icinga
# 1.56 Fri, 15 Mar 2013 20:47:13 +0100
# applied patch from Niklas Edmundsson <Niklas.Edmundsson@hpc2n.umu.se>:
# check processor and memory details
# applied patches from Dragan Sekerovic <dragan.sekerovic@onestep2.at>:
# add location label to temperature (option "-b")
# support for checking event log (option "-l")
# add iLO version to output
# add 2 new values for power supply status
# --
# 1.55 Sun, 05 Aug 2012 20:18:46 +0200
# faulty drive (option "-c") exits now with CRITICAL instead of WARNING
# applied patches from Niklas Edmundsson <Niklas.Edmundsson@hpc2n.umu.se>:
# iLO4 RAID Controller Status
# nodriveexit
# add g6 drive status
# overall health probes every element now
# fixed bug with drive bay index
# supports iLO3 with multiple backplanes
# supports iLO4 disk check
# Note: overall health may show drive/storage status, even without "-c"
# --
# 1.54 Thu, 14 Jun 2012 21:36:40 +0200
# applied fix for iLO4 from Niklas Edmundsson <Niklas.Edmundsson@hpc2n.umu.se>
# --
# 1.53 Tue, 14 Feb 2012 19:47:40 +0100
# added new disk bay variant
# added power supply NOT APPLICABLE
# --
# 1.52 Wed, 27 Jul 2011 20:46:14 +0200
# fixed <LABEL VALUE = "Power Supplies"/> again
# --
# 1.51 Mon, 25 Jul 2011 19:36:53 +0200
# fixed bug with chunked replies by Matthew Stier
# --
# 1.5 Sat, 16 Jul 2011 10:02:10 +0200
# optimized by Matthew Stier
# --
# 1.47 Thu, 14 Jul 2011 12:02:01 +0200
# also print perfdata when temperature output is disabled
# --
# 1.46 Wed, 06 Jul 2011 08:46:51 +0200
# fixed bug with nagios embedded perl interpreter
# --
# 1.45 Wed, 13 Oct 2010 22:17:01 +0200
# new option "--ilo3"
#
# "--checkdrives" enhancements
#
# <LABEL VALUE = "Power Supplies"/> shows always "Failed" even when the power
# supplies are redundant
#
# improved "--fanredundancy" and "--powerredundancy"
# --
# 1.44 Mon, 14 Dec 2009 20:11:37 +0100
# new option "--checkdrives"
# --
# 1.43 Mon, 17 Aug 2009 20:50:13 +0200
# new option "--fanredundancy"
#
# new option "--powerredundancy"
# --
# 1.42 Mon, 17 Aug 2009 12:52:23 +0100
# check power supply and fans redundancy
# gcivitella@enter.it
# --
# 1.41 Thu, 26 Jul 2007 17:42:36 +0200
# perfdata label ist now quoted
# --
# 1.4 Mon, 25 Jun 2007 09:45:52 +0200
# check vrm and power supply
#
# new option "--notemperatures"
#
# new option "--perfdata"
#
# some minor changes
# --
# 1.3beta Wed, 20 Jun 2007 09:57:46 +0200
# do some error checking
#
# new option "--inputfile"
# read bmc output from file
# --
# 1.2 Mon, 18 Jun 2007 09:33:17 +0200
# new option "--skipsyntaxerrors"
# ignores syntax errors in the xml output, maybe required by older firmwares
#
# introduce a date to the changelog ;)
# --
# 1.1 do not return warning if temperature status is n/a
#
# add "<LOCFG VERSION="2.21" />" to get rid of the
# "<INFORM>Scripting utility should be updated to the latest version.</INFORM>"
# message
# --
# 1 initial releaseuse strict;
use warnings;
use strict 'refs';use Monitoring::Plugin;
use Sys::Hostname;
use IO::Socket::SSL;
use XML::Simple;$Net::SSLeay::slowly = 5;use vars qw($VERSION $PROGNAME $verbose $warn $critical $timeout $result);
$VERSION = 1.62;$PROGNAME = "check_ilo2_health";# instantiate Nagios::Plugin
our $p = Monitoring::Plugin->new(usage => "Usage: %s [-H <host>] [ -u|--user=<USERNAME> ][ -p|--password=<PASSWORD> ] [ -f|--inputfile=<filename> ][ -a|--fanredundancy ] [ -c|--checkdrives ] [ -d|--perfdata ][ -e|--skipsyntaxerrors ] [ -n|--notemperatures ] [ -3|--ilo3 ][ -o|--powerredundancy ] [ -b|--locationlabel ] [ -l|--eventlogcheck][ -i|--ignorelinkdown ] [ -x|--ignorebatterymissing ] [ -s|--sslv3 ][ -t <timeout> ] [ -r <retries> ] [ -g|--getinfos ] [ --sslopts ][ -v|--verbose ] ",version => $VERSION,blurb => 'This plugin checks the health status on a remote iLO2|3|4 device
and will return OK, WARNING or CRITICAL. iLO (integrated Lights-Out)
can be found on HP Proliant servers.'
);$p->add_arg(spec => 'host|H=s',help =>qq{-H, --host=STRINGSpecify the host on the command line.},
);# add all arguments
$p->add_arg(spec => 'user|u=s',help =>qq{-u, --user=STRINGSpecify the username on the command line.},
);$p->add_arg(spec => 'password|p=s',help =>qq{-p, --password=STRINGSpecify the password on the command line.},
);$p->add_arg(spec => 'inputfile|f=s',help =>qq{-f, --inputfile=STRINGRead input from file.},
);$p->add_arg(spec => 'fanredundancy|a',help =>qq{-a, --fanredundancyCheck fan redundancy},
);$p->add_arg(spec => 'checkdrives|c',help =>qq{-c, --checkdrivesCheck drive bays.},
);$p->add_arg(spec => 'perfdata|d',help =>qq{-d, --perfdataEnable perfdata on output.},
);$p->add_arg(spec => 'locationlabel|b',help =>qq{-b, --locationlabelShow temperature with location.},
);$p->add_arg(spec => 'eventlogcheck|l',help =>qq{-l, --eventlogcheckParse ILO eventlog for interesting events (f.e. broken memory).},
);$p->add_arg(spec => 'skipsyntaxerrors|e',help =>qq{-e, --skipsyntaxerrorsSkip syntax errors on older firmwares.},
);$p->add_arg(spec => 'ignorebatterymissing|x',help =>qq{-x, --ignorebatterymissingIgnore Battery missing status.},
);$p->add_arg(spec => 'ignorelinkdown|i',help =>qq{-i, --ignorelinkdownIgnore NIC Link Down status (iLO4).},
);$p->add_arg(spec => 'notemperatures|n',help =>qq{-n, --notemperaturesDisable temperature listing.},
);$p->add_arg(spec => 'powerredundancy|o',help =>qq{-o, --powerredundancyCheck power redundancy.},
);$p->add_arg(spec => 'getinfos|g',help =>qq{-g, --getinfosDisplay additional infos like firmware version and servername. May need increased timeout.},
);$p->add_arg(spec => 'ilo3|3',help =>qq{-3, --ilo3Check iLO3|4 device.},
);$p->add_arg(spec => 'retries|r=i',help => qq{-r, --retries=INTEGERNumber of retries.},
);$p->add_arg(spec => 'sslv3|s',help => qq{-s, --sslv3Use sslv3 for connection.},
);$p->add_arg(spec => 'sslopts=s',help => qq{--ssloptsSets IO::Socket:SSL Options, defaults to 'SSL_verify_mode => SSL_VERIFY_NONE'.Some firmware may need --sslopts 'SSL_verify_mode => SSL_VERIFY_NONE, SSL_version => "TLSv1"'.},
);# parse arguments
$p->getopts;my $return = "OK";
my $message = "";
our $xmlinput = "";
our $isinput = 0;
our $drive_input = "";
our $is_drive_input = 0;
our $drive_xml_broken = 0;
our $client;
our $is_event_input = 0;
our $event_severity = "";
our $event_class = "";
our $event_description = "";
our %event_status;
my $host = $p->opts->host;
my $hostname = $p->opts->host;
my $username = $p->opts->user;
my $password = $p->opts->password;
my $inputfile = $p->opts->inputfile;
our $skipsyntaxerrors = defined($p->opts->skipsyntaxerrors) ? 1 : 0;
my $optfanredundancy = defined($p->opts->fanredundancy) ? 1 : 0;
my $optpowerredundancy = defined($p->opts->powerredundancy) ? 1 : 0;
my $notemperatures = defined($p->opts->notemperatures) ? 1 : 0;
our $optcheckdrives = defined($p->opts->checkdrives) ? 1 : 0;
my $optilo3 = defined($p->opts->ilo3) ? 1 : 0;
my $iloboardversion = defined($p->opts->ilo3) ? "ILO>=3" : "ILO2";
my $perfdata = defined($p->opts->perfdata) ? 1 : 0;
my $locationlabel = defined($p->opts->locationlabel) ? 1 : 0;
my $eventlogcheck = defined($p->opts->eventlogcheck) ? 1 : 0;
my $ignorelinkdown = defined($p->opts->ignorelinkdown) ? 1 : 0;
my $ignorebatterymissing = defined($p->opts->ignorebatterymissing) ? 1 : 0;
my $getinfos = defined($p->opts->getinfos) ? 1 : 0;
our %drives;
our $drive;
our $drivestatus;
our $product_name = "";
our $serial_number = "";
our $server_name = "";
my $retries=0;
my $xml;
my $sslv3 = defined($p->opts->sslv3) ? 1 : 0;
my $sslopts = 'SSL_verify_mode => SSL_VERIFY_NONE';
our @product;
our @serial;
our @sname;$message = "(Board-Version: $iloboardversion) ";unless ( ( defined($inputfile) ) ||( defined($host) && defined($username) && defined($password) ) ) {$p->nagios_die("ERROR: Missing host, password and user.");
}if ( defined ( $p->opts->retries ) ) {$retries = $p->opts->retries;
}if ( defined ( $p->opts->sslopts ) ) {$sslopts = $p->opts->sslopts;
}alarm $p->opts->timeout;my $boundary;
our $sendsize;
my $localhost = hostname() || 'localhost';
print "hostname is $localhost\n" if ( $p->opts->verbose );for (my $i=0;$i<=$retries;$i++) {print "retry: $i\n" if ( $p->opts->verbose );unless ( defined($inputfile) ) {# query code from locfg.pl# Set the default SSL port number if no port is specified$host .= ":443" unless ($host =~ m/:/);## Open the SSL connection and the input file$client = new IO::Socket::SSL->new(PeerAddr => $host, eval $sslopts, $sslv3 ? ( SSL_version => 'SSLv3' ) : () );unless ( $client ) {$p->nagios_exit(return_code => "UNKNOWN",message => "ERROR: Failed to establish SSL connection with $host $! $SSL_ERROR.");}if ( $optilo3 ) {print "sending ilo3\n" if ( $p->opts->verbose );my $cmd = '<?xml version="1.0"?>';$cmd .= '<LOCFG VERSION="2.21" />';$cmd .= '<RIBCL VERSION="2.21">';$cmd .= '<LOGIN USER_LOGIN="'.$username.'" PASSWORD="'.$password.'">';$cmd .= '<SERVER_INFO MODE="read">';$cmd .= '<GET_EMBEDDED_HEALTH />';if ( $eventlogcheck ) { $cmd .= '<GET_EVENT_LOG />';}if ( $getinfos ) {$cmd .= '<GET_HOST_DATA />';$cmd .= '<GET_PRODUCT_NAME />';$cmd .= '<GET_SERVER_NAME />';}$cmd .= '</SERVER_INFO>';$cmd .= '</LOGIN>';$cmd .= '</RIBCL>';$cmd .= "\r\n";send_or_calculate(0,$cmd);send_to_client(0, "POST /ribcl HTTP/1.1\r\n");send_to_client(0, "HOST: $hostname\r\n"); # Mandatory for http 1.1send_to_client(0, "TE: chunked\r\n");send_to_client(0, "Connection: Close\r\n"); # Requiredsend_to_client(0, "Content-length: $sendsize\r\n"); # Mandatory for http 1.1send_to_client(0, "\r\n");send_or_calculate(1,$cmd); #Send it to iLO}else {# send xml to BMCprint $client '<?xml version="1.0"?>' . "\r\n";print $client '<LOCFG VERSION="2.21" />' . "\r\n";print $client '<RIBCL VERSION="2.21">' . "\r\n";print $client '<LOGIN USER_LOGIN="'.$username.'" PASSWORD="'.$password.'">' . "\r\n";print $client '<SERVER_INFO MODE="read">' . "\r\n";print $client '<GET_EMBEDDED_HEALTH />' . "\r\n";if ( $eventlogcheck ) { print $client '<GET_EVENT_LOG />' . "\r\n"; }if ( $getinfos ) {print $client '<GET_HOST_DATA />' . "\r\n";print $client '<GET_PRODUCT_NAME />' . "\r\n";print $client '<GET_SERVER_NAME />' . "\r\n";}print $client '</SERVER_INFO>' . "\r\n";print $client '</LOGIN>' . "\r\n";print $client '</RIBCL>' . "\r\n";}}else {open($client,$inputfile) or $p->nagios_die("ERROR: $inputfile not found");}# retrieve dataif ( $optilo3 && !$inputfile ) {read_chunked_reply();}else {while (my $ln = <$client>) {parse_reply($ln);}close $client;}# parse with XML::Simpleif ( $xmlinput && $isinput == 0 ) {$xml = eval { XMLin($xmlinput, ForceArray => 1) };if ( $@ ) {if ( $i < $retries ) { next;}$p->nagios_exit(return_code => "UNKNOWN",message => "ERROR: $@");}else {last;}}else {$p->nagios_exit(return_code => "UNKNOWN",message => "ERROR: No parseable output.");}
}if ( $getinfos ) {$serial_number = "";if ( defined $serial[3] ) {$serial[3] =~ tr/ //ds ;$serial_number = "Serial: $serial[3]";}$server_name = "";$server_name = " - Servername: $sname[1]" if defined $sname[1];my $system_rom = undef;my $firmware_name = undef;my $firmware_version = undef;# loop through firmware hashforeach my $index (keys %{ $xml->{'FIRMWARE_INFORMATION'}[0] }) {if (defined $xml->{'FIRMWARE_INFORMATION'}[0]->{$index}[0]->{'FIRMWARE_NAME'}[0]->{'VALUE'}) {if ($xml->{'FIRMWARE_INFORMATION'}[0]->{$index}[0]->{'FIRMWARE_NAME'}[0]->{'VALUE'} eq "iLO") {$firmware_name = 'iLO';$firmware_version = $xml->{'FIRMWARE_INFORMATION'}[0]->{$index}[0]->{'FIRMWARE_VERSION'}[0]->{'VALUE'};} elsif ($xml->{'FIRMWARE_INFORMATION'}[0]->{$index}[0]->{'FIRMWARE_NAME'}[0]->{'VALUE'} eq "HP ProLiant System ROM") {$system_rom = $xml->{'FIRMWARE_INFORMATION'}[0]->{$index}[0]->{'FIRMWARE_VERSION'}[0]->{'VALUE'};}}}my $product_name = undef;if (! defined $product[1]) {$product_name = "Unknown product";} else {$product_name = $product[1]}$serial_number = "Unknown serial" if ! defined $serial_number;$firmware_name = "iLO" if ! defined $firmware_name;$firmware_version = "Unknown firmware version" if ! defined $firmware_version;$server_name = "Unknown server name" if ! defined $server_name;if (defined $system_rom) {$message = "($product_name - SystemROM: $system_rom - $serial_number - $firmware_name FW $firmware_version" . "$server_name) ";} else {$message = "($product_name - $serial_number - $firmware_name FW $firmware_version" . "$server_name) ";}
}my $drive_xml;
if ( $optcheckdrives && !$drive_xml_broken ) {if ( $drive_input && $is_drive_input == 0 ) {$drive_xml = eval { XMLin($drive_input, ForceArray => 1) };if ( $@ ) {$p->nagios_exit(return_code => "UNKNOWN",message => "ERROR: $@");}}elsif ( ref $xml->{'STORAGE'}[0]->{'CONTROLLER'} ) {# iLO4 specific, no need for $drive_input}else {# No need to error out if host uncapable of checking drive statuswarn "No drive_input found" if ( $p->opts->verbose );}
}my $temperatures = $xml->{'TEMPERATURE'}[0]->{'TEMP'};
my $backplanes = $drive_xml->{'BACKPLANE'};
my $raidcontroller = $xml->{'STORAGE'}[0]->{'CONTROLLER'};
my @checks;
push(@checks,$xml->{'FANS'}[0]->{'FAN'});
push(@checks,$xml->{'VRM'}[0]->{'MODULE'});
push(@checks,$xml->{'POWER_SUPPLIES'}[0]->{'SUPPLY'});
if($xml->{'PROCESSORS'}) {push(@checks,$xml->{'PROCESSORS'}[0]->{'PROCESSOR'});
}
my $memdetails;
if($xml->{'MEMORY'}) {$memdetails = $xml->{'MEMORY'}[0]->{'MEMORY_DETAILS'}[0];
}
my $health = $xml->{'HEALTH_AT_A_GLANCE'}[0];
my $label;
my $status;
my $temperature;
my $cautiontemp;
my $criticaltemp;## check overall health statusmy $componentstate;
foreach (keys %{$health}) {$componentstate = $health->{$_}[0]->{'STATUS'};if ( defined($componentstate) && ( $componentstate !~ m/^Ok$|^OTHER$|^NOT APPLICABLE$/i ) ) {if ($_ eq 'STORAGE') {if ( ref($raidcontroller) ) {# For iLO4 we can look at the raid controller to get a more detailed# status, so just log a WARNING unless we find something CRITICAL# later on.$return = "WARNING" unless ( $return eq "CRITICAL" );}else {$return = "CRITICAL";}}elsif ( ( $_ eq 'BATTERY' ) && $ignorebatterymissing && ( $componentstate =~ m/^Not Installed$/i ) ) {next;}elsif ( ( $_ eq 'NETWORK' ) && $ignorelinkdown && ( $componentstate =~ m/^Link Down$/i || $componentstate =~ m/^Degraded$/i ) ) {next;}else {$return = "CRITICAL";}$message .= "$_ $componentstate, ";}
}if ( $optpowerredundancy ) {my $powerredundancy = $health->{'POWER_SUPPLIES'}[1]->{'REDUNDANCY'};if ( defined($powerredundancy) &&( $powerredundancy !~ m/^Fully Redundant$|^REDUNDANT$|^NOT APPLICABLE$/i ) ) {$return = "CRITICAL";$message .= "Power supply $powerredundancy, ";}
}if ( $optfanredundancy ) {my $fanredundancy = $health->{'FANS'}[1]->{'REDUNDANCY'};if ( defined($fanredundancy) &&( $fanredundancy !~ m/^Fully Redundant$|^REDUNDANT$|^NOT APPLICABLE$/i ) ) {$return = "CRITICAL";$message .= "Fans $fanredundancy, ";}
}# check fans, vrm and power supplies
foreach my $check ( @checks ) {if ( ref($check) ) {foreach my $item ( @$check ) {$label=$item->{'LABEL'}[0]->{'VALUE'};$status=$item->{'STATUS'}[0]->{'VALUE'};if ( defined($label) && defined($status) ) {# misleading output on some iLO3 shows always failed, skip itif ($label =~ m/^Power Supplies$/) {next;}if ($label =~ m/^Power Supply/) {# get details for power supplies$label =~ s/ /_/g;if ( ( $status !~ m"^Ok$|^Good|^n/a$|^Not Installed$|^Unknown$"i ) ) {$return = "WARNING" unless ( $return eq "CRITICAL" );if ( defined($item->{'MODEL'}[0]->{'VALUE'}) ) {$message .= "$label is $status (ModelNumber: $item->{'MODEL'}[0]->{'VALUE'}) ";}else {$message .= "$label is $status ";}}next;}$label =~ s/ /_/g;if ( ( $status !~ m"^Ok$|^Good|^n/a$|^Not Installed$|^Unknown$"i ) ) {$return = "WARNING" unless ( $return eq "CRITICAL" );$message .= "$label: $status, ";}}}}
}# check memory status (iLO4 only?)
if ( ref($memdetails) ) {foreach my $loc ( sort keys %{$memdetails} ) {foreach ( @{$memdetails->{$loc}} ) {$status = $_->{'STATUS'}[0]->{'VALUE'};if ( ( $status !~ m"^Ok$|^Good|^n/a$|^Not Present$"i ) ) {$return = "WARNING" unless ( $return eq "CRITICAL" );my $socket = $_->{'SOCKET'}[0]->{'VALUE'};my $size = $_->{'SIZE'}[0]->{'VALUE'};my $part = $_->{'PART'}[0]->{'NUMBER'};if ( defined $part ) {# works only with new iLO4 firmware$message .= "Mem $loc $socket: $status (Size: $size, PartNumber: $part), ";}else {$message .= "Mem $loc $socket: $status (Size: $size), ";}}}}
}# check newer drive bays (iLO3)
if ( ref($backplanes) ) {my $backplane = 0;foreach ( @{$backplanes} ) {if ( defined($_->{'ENCLOSURE_ADDR'}[0]->{'VALUE'} ) ) {$backplane = $_->{'ENCLOSURE_ADDR'}[0]->{'VALUE'};}else {$backplane++;}if ( $_->{'DRIVE_BAY'} ) {for ( my $i=0; $i<= $#{$_->{'DRIVE_BAY'}}; $i++ ) {$label=$backplane." ".$_->{'DRIVE_BAY'}[$i]->{'VALUE'};$status=$_->{'STATUS'}[$i]->{'VALUE'};$drives{$label}{'status'} = $status;}}if ( $_->{'DRIVE'} ) {for ( my $i=0; $i<= $#{$_->{'DRIVE'}}; $i++ ) {$label=$backplane." ".$_->{'DRIVE'}[$i]->{'BAY'};$status=$_->{'DRIVE_STATUS'}[$i]->{'VALUE'};$drives{$label}{'status'} = $status;}}}
}# seems that iLO4 reads the state from the RAID controller, nice
if ( ref($raidcontroller) ) {foreach ( @{$raidcontroller} ) {my $ctrllabel = $_->{'LABEL'}[0]->{'VALUE'};my $ctrlstatus = $_->{'CONTROLLER_STATUS'}[0]->{'VALUE'} || $_->{'STATUS'}[0]->{'VALUE'};if($ctrlstatus ne 'OK') {$return = "CRITICAL";$message .= "SmartArray $ctrllabel Status: $ctrlstatus, ";}my $cachestatus = $_->{'CACHE_MODULE_STATUS'}[0]->{'VALUE'};if($cachestatus && $cachestatus ne 'OK') {# FIXME: There are probably other valid cache module states that# needs to be excluded.$return = "CRITICAL";$message .= "SmartArray $ctrllabel Cache Status: $cachestatus, ";}foreach ( @{$_->{'DRIVE_ENCLOSURE'}} ) {my $enclabel = $_->{'LABEL'}[0]->{'VALUE'};my $encstatus = $_->{'STATUS'}[0]->{'VALUE'};my $encmodel = $_->{'MODEL_NUMBER'}[0]->{'VALUE'};if($encstatus ne 'OK') {$message .= "SmartArray $ctrllabel Enclosure $enclabel: $encstatus (ModelNumber: $encmodel) - check hardware status in OS, ";$return = "CRITICAL";}}foreach ( @{$_->{'LOGICAL_DRIVE'}} ) {my $ldlabel = $_->{'LABEL'}[0]->{'VALUE'};my $ldstatus = $_->{'STATUS'}[0]->{'VALUE'};if($ldstatus ne 'OK') {$message .= "SmartArray $ctrllabel LD $ldlabel: $ldstatus, ";if($ldstatus eq 'Degraded (Rebuilding)' || $ldstatus eq 'Degraded (Recovering)') {$return = "WARNING" unless ( $return eq "CRITICAL" );}else {$return = "CRITICAL";}}foreach ( @{$_->{'PHYSICAL_DRIVE'}} ) {$label = "$ctrllabel $_->{'LABEL'}[0]->{'VALUE'}";$status = $_->{'STATUS'}[0]->{'VALUE'};my $model = $_->{'MODEL'}[0]->{'VALUE'};$drives{$label}{'status'} = $status;$drives{$label}{'model'} = $model;}}}
}# check drive bays
if ( $optcheckdrives ) {foreach ( sort keys(%drives) ) {if ( ( $drives{$_}{'status'} !~ m"^(Ok)$|^(n/a)$|^(Spare)$|^(Not Installed)|^(Not Present/Not Installed)$|^(spun down)$"i ) ) {$return = "CRITICAL";$message .= "$_: ".$drives{$_}{'status'};if (defined $drives{$_}{'model'}){$message .= " (Drive ModelNumber: " . $drives{$_}{'model'} ."), ";}}}
}# check event logs
if ( $eventlogcheck ) {foreach ( keys %event_status ) {next if ( $event_status{$_} =~ m/Repaired/ );$message .= " $_:$event_status{$_} ";$return = "WARNING" unless ( $return eq "CRITICAL" );}
}unless ( $message ) {$message .= "No faults detected, ";
}# check temperatures
if ( ref($temperatures) ) {unless ( $notemperatures ) {$message .= "Temperatures: ";}foreach my $temp ( @$temperatures ) {$label=$temp->{'LABEL'}[0]->{'VALUE'};if ( $locationlabel && defined($temp->{'LOCATION'}[0]->{'VALUE'}) ) {$label .= " (" . $temp->{'LOCATION'}[0]->{'VALUE'} . ")";}$status=$temp->{'STATUS'}[0]->{'VALUE'};$temperature=$temp->{'CURRENTREADING'}[0]->{'VALUE'};if ( defined($label) && defined($status) && defined($temperature) ) {$label =~ s/ /_/g;unless ( ( $status =~ m"^Ok$|^n/a$|^Not Installed$"i ) ) {$return = "WARNING" unless ( $return eq "CRITICAL" );$message .= "$label ($status): $temperature, "if ( $notemperatures );}unless ( ( $status =~ m"^n/a$|^Not Installed$"i ) ) {$message .= "$label ($status): $temperature, "unless ( $notemperatures );if ( $perfdata ) {$cautiontemp=$temp->{'CAUTION'}[0]->{'VALUE'};$criticaltemp=$temp->{'CRITICAL'}[0]->{'VALUE'};# Returned value can be 'N/A', enforce this being a numberif($cautiontemp && $cautiontemp !~ /^[0-9]+/) {$cautiontemp=undef;}if($criticaltemp && $criticaltemp !~ /^[0-9]+/) {$criticaltemp=undef;}if ( defined($cautiontemp) && defined($criticaltemp) ) {$p->set_thresholds(warning => $cautiontemp,critical => $criticaltemp,);my $threshold = $p->threshold;# add perfdata$p->add_perfdata(label => $label,value => $temperature,uom => "",threshold => $threshold,);}}}}else {$message .= "no reading, ";}}
}# strip trailing ","
$message =~ s/, $//;$p->nagios_exit(return_code => $return,message => $message
);# send_to_client, send_or_calculate and read_chunked_reply
# are adapted from locfg.plsub send_to_client
{my ($send, $cmd) = @_;print $cmd if ( $p->opts->verbose && length($cmd) < 1024 );print $client $cmd;$sendsize -= length($cmd) if ( $send );
}sub send_or_calculate # used for iLO 3 only
{$sendsize = 0;my ($send, $cmd) = @_;if ($send) {print $client $cmd;}$sendsize += length($cmd);print "size $sendsize\n" if ( $p->opts->verbose );
}sub read_chunked_reply # used for iLO 3 only
{my $ln = "";my $lp = "";my $hide = 1;my $chunk = 1;my $chunkSize;while( 1 ) {# Read a line$ln = <$client>;# Get length of linemy $length = length($ln);# Exit loop if zeroif ( $length == 0 ) {if ( $p->opts->verbose ) {print "read_chunked_reply: read a zero-length line. Continue...\n";}last;}# Skip HTTP headers and first line of chunked responsesif ( $hide ) {$hide = 0 if ( $ln =~ m/^\r\n$/ );print "Head: " . $ln if ( $p->opts->verbose );next;}# Get size of chunkif ( $chunk ) {print "chunk: " . $ln if ( $p->opts->verbose );$ln =~ s/\r|\n//g;$chunkSize = hex($ln);$chunk = 0;print "chunk size: $chunkSize\n" if ( $p->opts->verbose );next;}# Last Chunkif ( $chunkSize == 0 ) {print "read_chunked_reply: reach end of responses.\n" if ($p->opts->verbose);last;}# End of chunk, process incomplete lineif ( $chunkSize < $length ) {$chunk = 1; # Next line, new chunk$hide = 0; # Skip hide$lp .= substr($ln, 0, $chunkSize); # Truncate and append}# End of chunk, process complete lineelsif ( $chunkSize == $length ) {$chunk = 1; # Next line, new chunk$hide = 1; # Hide new chunk's first line$lp .= $ln; # Append line as-is}# Process lineelse {$chunkSize -= $length; # Decrement chunk size$lp .= $ln; # Append line as-is}# Skip incomplete linenext unless ( $lp =~ m/\n$/ );# Parse complete lineparse_reply($lp);# Line parsed, clear line$lp = "";}if ($client->error()) {print "Error: connection error " . $client->error() . "\n";}
}sub parse_reply
{my ($line) = @_;$line =~ s/\r\n$/\n/;print $line if ( $p->opts->verbose );if ( $getinfos ) {# Prune all unnecessary lines$isinput = 1 if ( $line =~ m"<GET_EMBEDDED_HEALTH_DATA>|</DRIVES>" );$xmlinput .= $line if ( $isinput );$isinput = 0 if ( $line =~ m"</GET_EMBEDDED_HEALTH_DATA>|<DRIVES>" );$product_name = $line if ( $line =~ m"<PRODUCT_NAME VALUE" );$serial_number = $line if ( $line =~ m/FIELD NAME="Serial Number"/ );$server_name = $line if ( $line =~ m"<SERVER_NAME" );@product = split (/"/, $product_name) if defined $product_name;@serial = split (/"/, $serial_number) if defined $serial_number;@sname = split (/"/, $server_name ) if defined $server_name;}else {# Prune all unnecessary lines$isinput = 1 if ( $line =~ m"<GET_EMBEDDED_HEALTH_DATA>|</DRIVES>|</FIRMWARE_INFORMATION>" );$xmlinput .= $line if ( $isinput );$isinput = 0 if ( $line =~ m"</GET_EMBEDDED_HEALTH_DATA>|<DRIVES>|<FIRMWARE_INFORMATION>" );}# drive check needs special handling# <DRIVES># <BACKPLANE># <FIRMWARE_VERSION VALUE="1.18"/># <ENCLOSURE_ADDR VALUE="224"/># <DRIVE_BAY VALUE = "1"/># <PRODUCT_ID VALUE = "EH0300FBQDD "/># <STATUS VALUE = "Ok"/># <UID_LED VALUE = "Off"/># <DRIVE_BAY VALUE = "2"/># <PRODUCT_ID VALUE = "EH0300FBQDD "/># <STATUS VALUE = "Fault"/># <UID_LED VALUE = "Off"/># </BACKPLANE># </DRIVES>$is_drive_input = 1 if ( $line =~ m"<DRIVES>" );$drive_input .= $line if ( $is_drive_input );$is_drive_input = 0 if ( $line =~ m"</DRIVES>" );# because on many (older?) iLOs drive status is not XMLif ($optcheckdrives) {if ( $line =~ m/<Drive Bay: / ) {$drive_xml_broken = 1;# <Drive Bay: "3"; status: "Smart Error"; uid led="Off"/>( $drive, $drivestatus ) = ( $line =~m/Drive Bay: "(.*)"; status: "(.*)"; uid led: ".*"/ );if ( defined($drive) && defined($drivestatus) ) {$drives{$drive} = $drivestatus;}}if ( $line =~ m/<DRIVE BAY=".*" PRODUCT_ID="/ ) {$drive_xml_broken = 1;# <DRIVE BAY="3" PRODUCT_ID="N/A"STATUS="Smart Error" UID_LED="Off"/>( $drive, $drivestatus ) = ( $line =~m/DRIVE BAY="(.*)" PRODUCT_ID=".*"STATUS="(.*)" UID_LED=".*"/ );if ( defined($drive) && defined($drivestatus) ) {$drives{$drive} = $drivestatus;}}}if ( $eventlogcheck ) {$is_event_input = 1 if ( $line =~ m"<EVENT" );if ( $is_event_input ) {if ( $line =~ m/SEVERITY="(.*?)"/ ) {$event_severity = $1;#print "SEV: $event_severity\n";}if ( $line =~ m/CLASS="(.*?)"/ ) {$event_class = $1;#print "CLASS: $event_class\n";}if ( $line =~ m/DESCRIPTION="(.*?)"/ ) {$event_description = $1;#print "DESCRIPTION: $event_description\n";}}$is_event_input = 0 if ( $is_event_input && $line =~ m"/>" );if ( $is_event_input == 0 && $event_class ) {if ( ($event_class !~ m/POST|Maintenance/) && ( $event_severity !~ m/Informational/) ) {$event_status{$event_description} = $event_severity;$event_class = "";}}}if ( $line =~ m/MESSAGE='(.*)'/ ) {my $msg = $1;if ( $msg =~ m/No error/i ) {# Skip}elsif ( $msg =~ m/Syntax error/i && $skipsyntaxerrors ) {# Skip}else {close $client;$p->nagios_exit(return_code => "UNKNOWN",message => "ERROR: $msg.");}}
}
相关文章:

刚刚,百度宣布王海峰升任CTO
作者 | 夕颜、一一出品 | AI科技大本营(ID:rgznai100)导读:5 月 31 日,百度宣布,百度原高级副总裁王海峰升任百度 CTO,成为百度在组织大变革中一批“敢打硬仗”的代表人物得到晋升的典型。在百度人事动荡之…

【FFmpeg】结构体详解(一):AVCodec、AVCodecContext、AVCodecParserContext、AVFrame、AVFormatContext 、AVIOContext
FFmpeg结构体详解 一、FFmpeg中最关键的结构体之间的关系1、解协议(http,rtsp,rtmp,mms)2、解封装(flv,avi,rmvb,mp4)3、解码(h264,mpeg2,aac,mp3)4、存数据二、结构体详解1、AVCodec 是存储编解码器信息的结构体。1.1 enum AVMediaType type1.2 enum AVCodecID id1.3 co…

大一新生,你为何逃课?
昨晚不知在哪看到对现在大学生的描述,说现在的大学生30%的时间在应对无聊的思政课,30%的时间在忙着考英语等级,剩下40%的时间在忙着花前月下,“还忙不过来”,虽然不是全部大学生都这样,但也确实有不少的学生…

【FFmpeg】结构体详解(二):AVStream、AVPacket、AVOutputFormat
FFmpeg结构体详解 7、AVStream8、AVPacket9、AVOutputFormat7、AVStream AVStream 是存储每一个视频/音频流信息的结构体。 重要的变量如下所示: int index: 标识该视频/音频流 AVCodecContext *codec: 指向该视频/音频流的AVCodecContext(它们是一一对应的关系) AVR…

谷歌 Fuchsia 上手体验,将取代Android/win10
2019独角兽企业重金招聘Python工程师标准>>> 在手机市场领域,Google表现很抢眼,毫无疑问,Android 至今在移动操作系统的市场份额占据绝对领先地位,但是 Android 仍然存在不少问题,碎片化问题严重࿰…

美亚Kindle排名第一的Python 3入门书,火遍了整个编程圈
“大多数优秀的程序员从事编程工作,不是因为期望获得报酬或得到公众的称赞,而是因为编程是件有趣的事儿。”——林纳斯托瓦兹(Linus Torvalds)在美国亚马逊,有一本书的影响力超高的Python入门书,Kindle版本…

seo笔记——搜索显示
一、搜索显示的几个列表形式 1、经典搜索结果列表: 用户搜索时,出现的第一行都是网页的标题(title),颜色醒目的部分是用户搜索的相关内容; 使用百度搜索则第二第三行是网页的说明内容(Des…

【FFmpeg】函数详解(一)
FFmpeg函数详解 一、错误码相关1、AVERROR2、av_strerror3、其他错误码解释二、编解码1、获取编解码器2、申请、释放上下文环境3、打开编码器avcodec_open24、分配一个 AVFrame:av_frame_alloc5、av_frame_get_buffer6、avformat_alloc_output_context27、avformat_new_stream…

第5章 图像分类的数据集
第5章图像分类的数据集 在我们实际进入到代码编写阶段来构建分类器之前,我们首先回顾下在本书中用到的数据集。一些数据集可理想的获得大于95%的准确率,另一些则还在开放研究阶段,还有一些是图像分类竞赛的部分数据集。 现在就对这些数据集进…

一根烟上热搜,先让AI看看你的肺
作者 | 李翔,国内某互联网大厂AI民工,前携程酒店图像技术负责人,计算机视觉和深度学习重度爱好者,在ICCV和CVPR等会议上发表论文十余篇;马杰超,任职于某医学图像创业公司,医学图像AI领域资深从业…

mongodb主从设置,capped collections等常用命令集合
############### Mongodb 主 <> 从切换的时候要删除 ############## ############### use local ############################### ############## db.sources.remove() ############################### # 主#/data/mongodb-linux-x86_64-2.0.2/bin/mongod --por…

调侃吴恩达,Diss特斯拉,吐槽OpenAI…《AI寒冬将至》作者点评2019“AI小丑秀”...
作者 | Piekniewski编译 | 夕颜出品 | AI科技大本营(ID: rgznai100)导读:去年,一篇《AI寒冬将至》的文章在AI圈爆红,作者观点鲜明地指出AI领域出现泡沫,并预言AI寒冬将会到来,引起巨大争议。一年…

max_semi_space_size 设置值与实际值不一致的原因分析
问题由来 因为业务的需求,某 Node.js 性能平台用户需要调节新生代大小,Node.js 的启动参数里面的max_semi_space_size可以设置新生代堆空间的大小。 node --v8-options | grep max_semi -A 3 -B 2--min_semi_space_size (min size of a semi-space (in M…

【FFmpeg】函数详解(二)
FFmpeg函数详解 9、av_dump_format10、avio_open11、avformat_write_header12、avcodec_send_frame13、avcodec_receive_packet9、av_dump_format 原型: void av_dump_format(AVFormatContext *ic, int index, const char *url, int is_output);说明: 打印输入输出格式的详…

【Visual C++】游戏开发笔记二十七 Direct3D 11入门级知识介绍
游戏开发笔记二十七 Direct3D 11入门级知识介绍作者:毛星云 邮箱: happylifemxy163.com 期待着与志同道合的朋友们相互交流上一节里我们介绍了在迈入DirectX 11的学习旅程之后第一个demo创建的全过程。但由于知识衔接的需要,我们的第一…

英特尔蚕食AMD和NVIDIA?
作者 | Daniel Newman译者 | 苏本如,责编 | 郭芮转载自CSDN(ID:CSDNnews)【编者按】一个鲜为人知的事实是,英特尔凭借其在集成显卡上的领先地位,持续占据着电脑显卡市场的头把交椅。但是随着过去两年中首席…

使用phpStudy运行伊人集项目
1.首次运行时,需要把system/config/install.look.php以及system/config/database.php(后面这个文件可以先不删除,若是安装过程中数据库报错,再来删除它)删除2.若只有一个项目版本需要运行的话,可以把项目拷…

【FFmpeg】函数详解(三)
FFmpeg函数详解 14、av_write_frame15、av_interleaved_write_frame16、av_write_trailer17、avio_close18、av_image_get_buffer_size19、av_image_fill_arrays20、av_rescale_q21、视频格式尺寸转换22、音频重采样:23、将像素格式由索引值转换成字符串24、MD5相关25、avio_h…

php时区问题导致php页面显示不正常
cacti安装成功,但报时区错误,已经做了如下操作,后来发现如上设置还是有此问题 将 /usr/local/php5/php.ini文件内修改如下 date.timezone asia/Chongqing 遂解决之。 转载于:https://blog.51cto.com/itnihao/916148

【FFmpeg】降低转码延迟方法、打印信息详解、refcounted_frames详解
文章目录 1、FFmpeg降低转码延迟方法2、ffmpeg打印信息:源码里打印的这段是这样定义的3、解码时 refcounted_frames 标志的使用3.1 启动该标志3.2 解码后,记得释放3.3 详解1、FFmpeg降低转码延迟方法 关闭sync-lookahead降低rc-lookahead,但别小于10,默认是-1降低threads(比…

速度提升270倍!微软和浙大联合推出全新语音合成系统FastSpeech
作者 | 谭旭转载自微软研究院AI头条(ID: MSRAsia)【编者按】目前,基于神经网络的端到端文本到语音合成技术发展迅速,但仍面临不少问题——合成速度慢、稳定性差、可控性缺乏等。为此,微软亚洲研究院机器学习组和微软&a…

Linux —— 目录(文件夹)及文件相关处理指令
可参考这篇文章:https://mp.weixin.qq.com/s?__bizMzU4MTU3OTI0Mg&mid2247484269&idx1&sn38869a1df48d8cdb6278518b51601ce0&chksmfd443be8ca33b2fe937531e061c406786f0e587d8ab10ff15594442265658d08cd8271ae52c5&mpshare1&scene23&s…

工业级3G路由器
宏电工业级3G路由器的特点,工业级标准设计,适应零上60度的高温,零下30度的低温,存工业级制造工艺,适应交通,环保,矿山,电力等工业级应用,欢迎来电索取解决方案,沈阳宏电办事处 刘冰 15940556464 024-31296279 限东三省地区.转载于:https://blog.51cto.com/lbing/916441

【FFmpeg】AVOutputFormat/AVInputFormat 成员变量 flags 总结
1、分类 AVOutputFormat中flags允许的值: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, AVFMT_TS_NONSTRICT, AVFMT_TS_NEGATIVEAVInputFormat中flags允许的值…

基础必备 | Python处理文件系统的10种方法
作者 | Jeff Hale 译者 | 风车云马;责编 | Jane,Rachel出品 | Python大本营(ID:pythonnews)【导读】在编写一些Python程序的时候,我们常常需要与文件系统进行交互。在本文中,营长为大家整理了10…

安装Oracle11g先决条件检查失败
体系结构 - 此先决条件将测试系统是否具有认证的体系结构。预期值:?N/A实际值:?N/A?错误列表:?-?PRVF-7536 : 无法在节点 "mywin7" 上执行体系结构检查 ?- Cause:? 无法确定系统体系结构。 ?-Action:? 确保正在使用正确的软件包。 处理 转载于:https://www.…

Windows Forms高级界面组件-使用状态栏控件
状态栏(StatusStrip)控件通常显示在窗体的底部,向用户提供有关应用程序状态的信息。如Word应用程序使用状态栏提供页码、行数和列数的信息。StatusStrip派生于ToolStrip,通常由ToolStripStatusLabel对象组成,用于显示指…

【Qt】在QtCreator中编译log4cplus
在QtCreator中编译log4cplus 一、在QtCreator中配置cmake二、编译log4cplus1、下载2、编译、安装一、在QtCreator中配置cmake 参见博客:https://blog.csdn.net/u010168781/article/details/107613606 log4cplus使用cmake来编译,因此需要QtCreator支持cmake 二、编译log4cpl…

IEEE“撑不住”了?声明解除对华为评审限制
整理 | 琥珀出品 | AI科技大本营(ID:rgznai100)6 月 2 日,IEEE 官方发表声明表示:经美国商务部就出口管制条例在 IEEE 出版活动中的适用性做出的说明,华为及其子公司的员工可以参加 IEEE 出版过程的同行评审和编辑工作…

关于软件产业的两个契机
软件产业是一个产业 , 和其它的产业一样 , 有各种角色分工 。 未来的软件是跨行业的 。 未来 , 软件会将各个行业联系在一起 。 云计算是第一代互联网发展到成熟的标志 。 网格计算是第二代互联网的开始 。 软件产业 在 未来 会 分为 平台&a…