I can use the below command to select a switch port's rrd path.
```
$switchName="Los-Angels-A"
$portName="Gi0/5";
$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.
How to query out the switch port bandwidth usage by given start time and end time?
Moderators: Developers, Moderators
-
- Posts: 3
- Joined: Mon Jun 03, 2019 5:58 am
Re: How to query out the switch port bandwidth usage by given start time and end time?
You basicallly need to get the name of the RRD file, then use RRDtool with a UNIX timestamp version of the start/end dates.
Cacti Developer & Release Manager
The Cacti Group
Director
BV IT Solutions Ltd
+--------------------------------------------------------------------------+
Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
The Cacti Group
Director
BV IT Solutions Ltd
+--------------------------------------------------------------------------+
Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
-
- Posts: 3
- Joined: Mon Jun 03, 2019 5:58 am
Re: How to query out the switch port bandwidth usage by given start time and end time?
Can you provide an example to me for explain more?
---
because the rrd file only store a moment's bandwidth speed, it do not store the usage amount. How can I get the bandwidth usage from a given time quantum?
Re: How to query out the switch port bandwidth usage by given start time and end time?
Cacti Developer & Release Manager
The Cacti Group
Director
BV IT Solutions Ltd
+--------------------------------------------------------------------------+
Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
The Cacti Group
Director
BV IT Solutions Ltd
+--------------------------------------------------------------------------+
Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Who is online
Users browsing this forum: No registered users and 1 guest