Looks like the promised download of stefan-benten satellite data has begun

Or it’s just some other test. Anyway, nice to see some egress.

The data does not seem to be deleted after download though, it will probably be deleted later:

2 Likes

Yep, every month I think this is the month that payout will be low. Then something like this happens. :slight_smile:

3 Likes

@BrightSilence me too ^^

Do you think it’s StorjLabs’ way to make SNOs do net get too low payments? :wink:

I don’t think it’s entirely a coincidence, no. :money_mouth_face:

2 Likes

Which software did you use to get this kind of diagram?

The first graph is from node API, the second is using this script to get the data.


In both cases, the data is then used by Zabbix to create the graphs.

The script is run by cron every minute and counts the new log entries (so, even when the log is erased, say, during an update, the count remains). The results are put in a json file, then Zabix just queries that file. I tested it with php7, but it should run on other versions too.

1 Like

FWIW, you can do all of this without an external script; Zabbix can analyze logs directly using keys like:

  • log.count[{$STORJ_LOG_PATH},\tpiecestore\tdeleted\t,,,skip]
  • log.count[{$STORJ_LOG_PATH},\tpiecestore\tdownloaded\t,,,skip]
  • and so on

That should work. The reason I wrote my script (this is the second version) was for performance. Running “docker logs …” (or, if I redirected the logs to a file, reading that file) takes a long time (when the node has been up for a few days) and if it was run for every data point my node VM would probably have unix load of 10.

My scripts runs once a minute and counts everything, then Zabbix or cacti can just read the values from the json file.

Note that log.count behaves this way as well. The agent remembers where it was in the file and only the count of matched lines is sent to the server.

That’s good to know, I don’t think I have used “log.count” before.

Note that it requires at least version 3.2 of the Zabbix agent – this was a bit annoying for me since the distro I’m running on has 3.0 packaged. I had to build the 4.0 agent from source.

how do you graph it in zabbix? I’m new to zabbix, I got the .json to show on zabbix but now how do I make a graph from it?
Thanks!
image

Sorry, I didn’t mention that you need another script to read from that file (it looked obvious to me).

#!/bin/bash
sat=$1
query=$2
res=`cat /opt/mon/actions2.json | jq ".\"$sat\".$query"`
nul=`echo "$res" | grep null | wc -l`
if [ $nul -eq 1 ]; then
        echo 0
else
        echo "$res"
fi

Save that as /opt/mon/actions2-zabbix.sh and put this line in the config of your zabbix agent:

UserParameter=storjactions2[*], /opt/mon/actions2-zabbix.sh $1 $2

Now you can create items like this: storjactions2[total, none.deleted], storjactions2[118UWpMCHzs6CvSgWd9BfFVjw5K9pZbJjkfZJexMtSkmKxvvAW, GET.download_canceled] and so on.