# Have a nice cli for InfluxDB

I tried the nodejs version and … well … it was horrible. Basic things didn’t work. Made life very annoying.

So, being a good engineering type, I wrote my own. It will be up on our site soon. Here’s an example

./influxdb-cli.pl --host 192.168.5.117 --user test --pass test --db metrics


 metrics> \list series 

.----------------------------------.
| series name                      |
+----------------------------------+
| lightning.cputotals.idle         |
| lightning.cputotals.irq          |
| lightning.diskinfo.writes.sda    |
| lightning.nettotals.pktin.tap0   |
| lightning.nettotals.pktout.eth1  |
| lightning.swapinfo.free          |
| lightning.swapinfo.total         |
| lightning.diskinfo.wait.sda      |
.
.
.


Nice, eh?

Now

 metrics> select * from lightning.diskinfo.writes.sda limit 10 

.--------------------------------------.
|     lightning.diskinfo.writes.sda    |
+------------+-----------------+-------+
| time       | sequence_number | value |
+------------+-----------------+-------+
| 1408138307 |               1 |     4 |
| 1408138306 |               1 |     2 |
| 1408138305 |               1 |     3 |
| 1408138304 |               1 |     0 |
| 1408138303 |               1 |     2 |
| 1408138302 |               1 |    39 |
| 1408138301 |               1 |     2 |
| 1408138300 |               1 |     0 |
| 1408138299 |               1 |     0 |
| 1408138298 |               1 |    15 |
'------------+-----------------+-------'
metrics> \quit



Its not perfect, and I can’t change much yet, but a few more hours and this thing will be good enough to be very functional.

I used this already to fix something wrong with the Grafana display.

Note: there are other TSDB that were recommended to me. Two in particular I will be seeing what I can do with in the next few weeks, but I really wanted to get InfluxDB working the way I needed.

Viewed 78512 times by 4918 viewers