Bash script not updating

Asked by Tombox

Hi guys,

This is probably something silly that I'm missing but I'm struggling with a bash script that I've written to send out LTO library stats to graphite.

Here's the script;

echo "lto.stats.emptyslots $EMPTY_SLOTS `date +%s`" | nc my.graphitehost.com 2003
echo "lto.stats.lto4scratch $LTO4_SCRATCH `date +%s`" | nc my.graphitehost.com 2003
echo "lto.stats.lto6scratch $LTO6_SCRATCH `date +%s`" | nc my.graphitehost.com 2003

This script runs once every 24 hours.

If I run it manually I see it add in the data point into graphite but only as a singular point, I do not get any historical data in my graphs so all I'm seeing is 1 singular data point every 2 hours rather than a constant graph.

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
Tombox
Solved:
Last query:
Last reply:
Revision history for this message
Kieran Girvan (kierangirvan) said :
#1

I had a similar issue and was caused by an incorrectly configured storage schema. If you're expecting to send in data once a day, you should setup a storage schema to match this frequency e.g. if you wanted to store a single data point each day for one year you're storage schema would look like this:

[lto.stats_daily_one_year]
pattern = ^lto.stats.*
retentions = 1d:1y

If you do change your storage schema configuration, you'll need to restart your carbon-cache daemons. This will ensure any new metrics are created with the correct storage schema configuration. In order to adjust your existing metrics you'll need to use the whisper-resize.py script:

whisper-resize.py /opt/graphite/storage/whisper/metric/name.wsp 1d:1y

I hope that helps.

Revision history for this message
Jason Dixon (jason-dixongroup) said :
#2

Also realize that if those env vars aren't being populated correctly in your script, it won't work.

Jason

Revision history for this message
Tombox (p-tom-t) said :
#3

Aha, the storage schema did the trick. Thank you for that guys, really
appreciate it.

On Mon, Jan 25, 2016 at 11:02 AM, Jason Dixon <
<email address hidden>> wrote:

> Your question #283364 on Graphite changed:
> https://answers.launchpad.net/graphite/+question/283364
>
> Jason Dixon proposed the following answer:
> Also realize that if those env vars aren't being populated correctly in
> your script, it won't work.
>
> Jason
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/graphite/+question/283364/+confirm?answer_id=1
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/graphite/+question/283364
>
> You received this question notification because you asked the question.
>

Revision history for this message
Tombox (p-tom-t) said :
#4

Thanks guys