Last active
April 10, 2019 11:43
-
-
Save mettenian/2834650fe996a567fd8220aa27c3f132 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# Call this script as follows: watch -d -t ./monitor_iri.sh | |
node=$(curl http://localhost:14265 -X POST -H 'X-IOTA-API-Version: 1.4.1' 'Content-Type: application/json' -d '{"command": "getNodeInfo"}' 2>/dev/null) | |
neighbors=$(curl http://localhost:14265 -X POST -H 'X-IOTA-API-Version: 1.4.1' 'Content-Type: application/json' -d '{"command": "getNeighbors"}' 2>/dev/null) | |
echo $node | jq -r '["IRI","Latest","Solid","Tips"], ["--------------------------------------------------------------------------------"], ([.appVersion, .latestMilestoneIndex, .latestSolidSubtangleMilestoneIndex, .tips]) | @tsv' | |
echo '' | |
echo $neighbors | jq -r '["All","New","Sent","Invalid","Type","Address"], ["--------------------------------------------------------------------------------"], (.neighbors | .[] | [.numberOfAllTransactions, .numberOfNewTransactions, .numberOfSentTransactions, .numberOfInvalidTransactions, .connectionType, .address]) | @tsv' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment