IPMI sensors can have / and - in their name

tags/zabbix-agent-addons-0.2.132-1
Daniel Berteaud 4 years ago
parent e8f9e75886
commit cf1dbfbba0
  1. 4
      zabbix_scripts/util_generate_sensors_ini

@ -78,7 +78,7 @@ if ($ipmitool && -x $ipmitool){
chomp $l; chomp $l;
# Looks like # Looks like
# Inlet Temp | 04h | ok | 7.1 | 25 degrees C # Inlet Temp | 04h | ok | 7.1 | 25 degrees C
if ($l !~ m/^(\w+[\s\w]+?\w+)\s*\|.*\|\s*([\w\.\s]+)\s*\|.*\|\s*([\-\w\.\s]+)$/){ if ($l !~ m/^(\w+[\s\w\/\-]+?\w+)\s*\|.*\|\s*([\w\.\s]+)\s*\|.*\|\s*([\-\w\.\s]+)$/){
next SENSOR; next SENSOR;
} }
my $name = $1; my $name = $1;
@ -396,7 +396,7 @@ $cfg->write($output);
sub sensor_name{ sub sensor_name{
my $desc = shift; my $desc = shift;
my $id = lc $desc; my $id = lc $desc;
$id =~ s/\s/_/g; $id =~ s/[^\w]/_/g;
$id =~ s/%/percent/g; $id =~ s/%/percent/g;
$id =~ s/_rpm$//; $id =~ s/_rpm$//;
return $id; return $id;

Loading…
Cancel
Save