Skip to content

Instantly share code, notes, and snippets.

@mettenian
Last active April 10, 2019 11:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mettenian/2834650fe996a567fd8220aa27c3f132 to your computer and use it in GitHub Desktop.
Save mettenian/2834650fe996a567fd8220aa27c3f132 to your computer and use it in GitHub Desktop.
#!/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