$opt[1] = " --vertical-label \"Traffic\" -b 1000 --title \"Interface Traffic for $hostname / $servicedesc\" ";
$def[1] = "DEF:var1=$rrdfile:$DS[1]:AVERAGE " ;
$def[1] .= "DEF:var2=$rrdfile:$DS[2]:AVERAGE " ;
$def[1] .= "LINE1:var1#003300:\"in \" " ;
$def[1] .= "GPRINT:var1:LAST:\"%7.2lf %Sb/s last\" " ;
$def[1] .= "GPRINT:var1:AVERAGE:\"%7.2lf %Sb/s avg\" " ;
$def[1] .= "GPRINT:var1:MAX:\"%7.2lf %Sb/s max\\n\" " ;
$def[1] .= "LINE1:var2#00ff00:\"out \" " ;
$def[1] .= "GPRINT:var2:LAST:\"%7.2lf %Sb/s last\" " ;
$def[1] .= "GPRINT:var2:AVERAGE:\"%7.2lf %Sb/s avg\" " ;
$def[1] .= "GPRINT:var2:MAX:\"%7.2lf %Sb/s max\\n\" ";
$def[1] .= "VDEF:totalin=var1,TOTAL ";
$def[1] .= "VDEF:totalout=var2,TOTAL ";
$def[1] .= "GPRINT:totalin:\"%3.2lf %s ttl\\n\" ";
$def[1] .= "GPRINT:totalout:\"%3.2lf %s ttl\\n\" ";
$opt[1] = " --vertical-label \"Traffic\" -b 1000 --title \"Interface Traffic for $hostname / $servicedesc\" ";
$def[1] = "DEF:var1=$rrdfile:$DS[1]:AVERAGE " ;
$def[1] .= "DEF:var2=$rrdfile:$DS[2]:AVERAGE " ;
$def[1] .= "VDEF:totalin=var1,TOTAL ";
$def[1] .= "VDEF:totalout=var2,TOTAL ";
$def[1] .= "LINE1:var1#003300:\"in \" " ;
$def[1] .= "GPRINT:var1:LAST:\"%7.2lf %Sb/s last\" " ;
$def[1] .= "GPRINT:var1:AVERAGE:\"%7.2lf %Sb/s avg\" " ;
$def[1] .= "GPRINT:var1:MAX:\"%7.2lf %Sb/s max\" " ;
$def[1] .= "GPRINT:totalin:\"%3.2lf %s ttl\\n\" ";
$def[1] .= "LINE1:var2#00ff00:\"out \" " ;
$def[1] .= "GPRINT:var2:LAST:\"%7.2lf %sb/s last\" " ;
$def[1] .= "GPRINT:var2:AVERAGE:\"%7.2lf %Sb/s avg\" " ;
$def[1] .= "GPRINT:var2:MAX:\"%7.2lf %Sb/s max\" ";
$def[1] .= "GPRINT:totalout:\"%3.2lf %s ttl\\n\" ";
Source: https://habr.com/ru/post/88100/
All Articles