Projet

Général

Profil

Révision 36ac271c

ID36ac271c5d7a6c3d593f3bbffec07c692480e7c2
Parent 7777738e
Enfant bfe824f7

Ajouté par Diego Elio Pettenò il y a environ 13 ans

snmp__if_combined: don't use cdef to generate the final value.

This actually simplifies the code, and avoids extra work on the master
side for no reason.

Voir les différences:

plugins/snmp/snmp__if_combined
613 613
      print <<END;
614 614
recv$if.label $alias
615 615
recv$if.graph no
616
recv$if.cdef recv$if,8,*
617 616
send$if.label $alias
618 617
send$if.negative recv$if
619
send$if.cdef send$if,8,*
620 618
END
621 619
    }
622 620
}
......
666 664
recv.label bps
667 665
recv.type DERIVE
668 666
recv.graph no
669
recv.cdef recv,8,*
670 667
recv.min 0
671 668
send.label bps
672 669
send.type DERIVE
673 670
send.negative recv
674
send.cdef send,8,*
675 671
send.min 0
676 672
END
677 673

  
......
722 718
	goto if_errors;
723 719
    }
724 720

  
725
    if (defined ($response = $snmpinfoX->{$if}->{ifHCInOctets} ||
726
		 $snmpinfo->{$if}->{ifInOctets})) {
727
	print "recv.value $response\n";
728
    } else {
729
	# No response...
730
	print "recv.value U\n";
731
   }
721
    $response = $snmpinfoX->{$if}->{ifHCInOctets} || $snmpinfo->{$if}->{ifInOctets};
722
    printf("recv.value %s\n", defined($response) ? ($response * 8) : "U");
732 723

  
733
    if (defined ($response = $snmpinfoX->{$if}->{ifHCOutOctets} ||
734
		 $snmpinfo->{$if}->{ifOutOctets})) {
735
	print "send.value $response\n";
736
    } else {
737
	# No response...
738
	print "send.value U\n";
739
    }
724
    $response = $snmpinfoX->{$if}->{ifHCOutOctets} || $snmpinfo->{$if}->{ifOutOctets};
725
    printf("send.value %s\n", defined($response) ? ($response * 8) : "U");
740 726

  
741 727
  if_errors:
742 728

  

Formats disponibles : Unified diff