Categories
Guide 折腾

修改 ServerStatus-V 探针脚本配合 vnStat 2.x 版本使用

网上常见的改版 ServerStatus 探针里采用的流量统计是根据 python 函数 psutil.net_io_counters() 所返回的数值来显示的。所以每次系统重启就会清零,作为检测小鸡每月流量有没有跑超的实用性不大。后来发现了以 vnStat 流量统计为基础的 ServerStatus-V 项目,用比较科学的自然月流量采集方式补足了原来 ServerStatus 的短板,这也是我一直沿用的版本。

最近适逢 Ubuntu 20.04 LTS 问世,我把手头上一大波的 VPS 系统更新,大致顺利。但后来发现探针监控台里越来越多小鸡的流量报告均为 0 | 0。难道是更新后比较节省流量吗?当然是不存在的。强迫症发作下无可奈何只好研究一下代码…

果然,问题就出现在这行代码里:

Categories
VPS

Quick config and optimization of your cloud instance

So you’ve got your first Linux VM, hurray! Here is a quick prep guide to get it up to speed.

In this example (and throughout this blog), I’ll assume you’re using the Debian-based Ubuntu 18.04 LTS – which is ideal as it comes with newer software packages and is quite a bit easier to manage than CentOS.

Setting hostname and timezone

After SSH-ing into the terminal, the first two things you’d want to do is update the hostname and timezone settings of your VM. These can be done by the following commands: