By default, node exporter supports collecting netstat info, but not all of it. When you run netstat -s
there are lots of useful information which are not present in the node-exporter's netstat info.
The statistics in netstat -s
come from two sources, /proc/net/netstat
and /proc/net/snmp
. node-exporter also uses these two sources, but does not collect all of its information. It uses a regex to filter and collect some of these stats.
Like me, you may need to collect one of these unexported metrics. In my case, I needed forwarded
or to be more accurate, ForwDatagrams
which indicates the number of forwarded packets. It's useful when you're running a software router and want to keep track of it in prometheus and grafana.
Fortunately, there is a way to change the regex and select which statistics you want to collect without changing the node-exporter source code.
In my case
I hereby claim:
- I am moh53n on github.
- I am moh53n (https://keybase.io/moh53n) on keybase.
- I have a public key ASDaDrqxYi1rght39D5fR8tP_29x1-fKpPfbq0f7yYgMxQo
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from lxml import html | |
from time import sleep | |
header = {} | |
status = {} | |
urls = [] | |
visited_urls = [] | |
entry = "https://microsoft.com/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This code is from "http://dillingers.com/blog/2015/04/18/how-to-make-an-altcoin" with some changes for newer versions of Bitcoin. | |
* Use this for mine the genesis block for a new coin. | |
* Put this before "consensus.hashGenesisBlock = genesis.GetHash();" | |
*/ | |
/////////GENESIS MINING/////////////// | |
/* | |
printf("Genesis mining started\n"); | |
genesis.nNonce = 0; | |
consensus.hashGenesisBlock = uint256S("0x001"); |