I can use the below command for select a switch port's rrd path.
$switchName="LS-SD-A"
$portName="Gi0/3";
$sql = "SELECT DTD.data_source_path FROM `host` AS H LEFT JOIN host_snmp_cache AS HSC ON ( HSC.host_id = H.id AND HSC.field_name = 'ifName' ) LEFT JOIN data_local AS DL ON ( DL.host_id = HSC.host_id AND HSC.snmp_index = DL.snmp_index ) LEFT JOIN data_template_data AS DTD ON ( DL.id = DTD.local_data_id ) WHERE HSC.field_value = '".$portName."' AND (H.description LIKE '".$switchName."' OR H.hostname LIKE '".$switchName."')";
But how can I query out the bandwidth usage by given start date time and end date time?
I mean if I give the start time
, end time
and Switch port
, I can query out the bandwidth usage of the Switch's port.