Platform: Linux, Python 3
This agent is used to stream host metric to InsightFinder.
Installation:
- Download this folder, modify config.yml.
- Run "hostmetric-streaming.py -h" to print usage.
This Script process below metricset:
-
CPU
[{"TIME":"2021-01-07 13:03:30","IP_ADDRESS":"10.222.55.55","HOSTNAME":"jq-ddzj-1","KPI":"host_cpu","CPU_USER":"0.003","CPU_SYSTEM":"0","CPU_WAIT":"0.002","CPU_IDLE":"0.995","CPU_USAGE":"0.005"},{"TIME":"2021-01-07 13:03:30","IP_ADDRESS":"10.222.55.54","HOSTNAME":"jq-ddzj-2","KPI":"host_cpu","CPU_USER":"0.033","CPU_SYSTEM":"0","CPU_WAIT":"0.002","CPU_IDLE":"0.964","CPU_USAGE":"0.035"}]
-
Memory
[{"TIME":"2021-01-07 13:06:30","IP_ADDRESS":"10.222.55.55","HOSTNAME":"jq-ddzj-1","KPI":"host_mem","MEM_USAGE":"0.46004","MEM_TOTAL":32006768,"SWAP_USAGE":"1.01987","SWAP_TOTAL":0},{"TIME":"2021-01-07 13:06:30","IP_ADDRESS":"10.222.55.54","HOSTNAME":"jq-ddzj-2","KPI":"host_mem","MEM_USAGE":"0.52698","MEM_TOTAL":32006768,"SWAP_USAGE":"1.01633","SWAP_TOTAL":0}]
-
Filesystem
[{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.54","HOSTNAME":"jq-ddzj-2","KPI":"host_fs","MOUNT":"/run/user/1501","FS_TOTAL":3200680,"FS_IDLE":"3200680","FS_USED":"0","FS_USAGE":"0","INODE_TOTAL":4000846,"INODE_IDLE":"4000845","INODE_USED":"1","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.55","HOSTNAME":"jq-ddzj-1","KPI":"host_fs","MOUNT":"/var","FS_TOTAL":4750976,"FS_IDLE":"2212184","FS_USED":"2538792","FS_USAGE":"0.54","INODE_TOTAL":327680,"INODE_IDLE":"170876","INODE_USED":"156804","INODE_USAGE":"0.48"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.54","HOSTNAME":"jq-ddzj-2","KPI":"host_fs","MOUNT":"/sys/fs/cgroup","FS_TOTAL":16003384,"FS_IDLE":"16003384","FS_USED":"0","FS_USAGE":"0","INODE_TOTAL":4000846,"INODE_IDLE":"4000833","INODE_USED":"13","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.54","HOSTNAME":"jq-ddzj-2","KPI":"host_fs","MOUNT":"/","FS_TOTAL":4750976,"FS_IDLE":"4693588","FS_USED":"57388","FS_USAGE":"0.02","INODE_TOTAL":327680,"INODE_IDLE":"325110","INODE_USED":"2570","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.54","HOSTNAME":"jq-ddzj-2","KPI":"host_fs","MOUNT":"/dev","FS_TOTAL":15993044,"FS_IDLE":"15993044","FS_USED":"0","FS_USAGE":"0","INODE_TOTAL":3998261,"INODE_IDLE":"3997804","INODE_USED":"457","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.54","HOSTNAME":"jq-ddzj-2","KPI":"host_fs","MOUNT":"/usr","FS_TOTAL":4750976,"FS_IDLE":"3226368","FS_USED":"1524608","FS_USAGE":"0.33","INODE_TOTAL":327680,"INODE_IDLE":"295274","INODE_USED":"32406","INODE_USAGE":"0.1"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.54","HOSTNAME":"jq-ddzj-2","KPI":"host_fs","MOUNT":"/boot","FS_TOTAL":457938,"FS_IDLE":"355166","FS_USED":"102772","FS_USAGE":"0.23","INODE_TOTAL":128016,"INODE_IDLE":"127680","INODE_USED":"336","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.54","HOSTNAME":"jq-ddzj-2","KPI":"host_fs","MOUNT":"/tmp","FS_TOTAL":4750976,"FS_IDLE":"4730048","FS_USED":"20928","FS_USAGE":"0.01","INODE_TOTAL":327680,"INODE_IDLE":"327637","INODE_USED":"43","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.54","HOSTNAME":"jq-ddzj-2","KPI":"host_fs","MOUNT":"/run/user/1000","FS_TOTAL":3200680,"FS_IDLE":"3200680","FS_USED":"0","FS_USAGE":"0","INODE_TOTAL":4000846,"INODE_IDLE":"4000845","INODE_USED":"1","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.54","HOSTNAME":"jq-ddzj-2","KPI":"host_fs","MOUNT":"/home","FS_TOTAL":78508796,"FS_IDLE":"31161832","FS_USED":"47346964","FS_USAGE":"0.61","INODE_TOTAL":5210112,"INODE_IDLE":"5134737","INODE_USED":"75375","INODE_USAGE":"0.02"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.54","HOSTNAME":"jq-ddzj-2","KPI":"host_fs","MOUNT":"/var","FS_TOTAL":4750976,"FS_IDLE":"2671320","FS_USED":"2079656","FS_USAGE":"0.44","INODE_TOTAL":327680,"INODE_IDLE":"166043","INODE_USED":"161637","INODE_USAGE":"0.5"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.54","HOSTNAME":"jq-ddzj-2","KPI":"host_fs","MOUNT":"/run","FS_TOTAL":16003384,"FS_IDLE":"16002692","FS_USED":"692","FS_USAGE":"0.01","INODE_TOTAL":4000846,"INODE_IDLE":"4000250","INODE_USED":"596","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.54","HOSTNAME":"jq-ddzj-2","KPI":"host_fs","MOUNT":"/dev/shm","FS_TOTAL":16003384,"FS_IDLE":"16003384","FS_USED":"0","FS_USAGE":"0","INODE_TOTAL":4000846,"INODE_IDLE":"4000845","INODE_USED":"1","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.55","HOSTNAME":"jq-ddzj-1","KPI":"host_fs","MOUNT":"/run/user/1501","FS_TOTAL":3200680,"FS_IDLE":"3200680","FS_USED":"0","FS_USAGE":"0","INODE_TOTAL":4000846,"INODE_IDLE":"4000845","INODE_USED":"1","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.55","HOSTNAME":"jq-ddzj-1","KPI":"host_fs","MOUNT":"/run/user/1506","FS_TOTAL":3200680,"FS_IDLE":"3200680","FS_USED":"0","FS_USAGE":"0","INODE_TOTAL":4000846,"INODE_IDLE":"4000845","INODE_USED":"1","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.55","HOSTNAME":"jq-ddzj-1","KPI":"host_fs","MOUNT":"/home","FS_TOTAL":78508796,"FS_IDLE":"30140188","FS_USED":"48368608","FS_USAGE":"0.62","INODE_TOTAL":5210112,"INODE_IDLE":"5129314","INODE_USED":"80798","INODE_USAGE":"0.02"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.55","HOSTNAME":"jq-ddzj-1","KPI":"host_fs","MOUNT":"/run/user/1000","FS_TOTAL":3200680,"FS_IDLE":"3200680","FS_USED":"0","FS_USAGE":"0","INODE_TOTAL":4000846,"INODE_IDLE":"4000845","INODE_USED":"1","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.55","HOSTNAME":"jq-ddzj-1","KPI":"host_fs","MOUNT":"/","FS_TOTAL":4750976,"FS_IDLE":"4660600","FS_USED":"90376","FS_USAGE":"0.02","INODE_TOTAL":327680,"INODE_IDLE":"325114","INODE_USED":"2566","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.55","HOSTNAME":"jq-ddzj-1","KPI":"host_fs","MOUNT":"/run","FS_TOTAL":16003384,"FS_IDLE":"16002848","FS_USED":"536","FS_USAGE":"0.01","INODE_TOTAL":4000846,"INODE_IDLE":"4000297","INODE_USED":"549","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.55","HOSTNAME":"jq-ddzj-1","KPI":"host_fs","MOUNT":"/dev","FS_TOTAL":15993044,"FS_IDLE":"15993044","FS_USED":"0","FS_USAGE":"0","INODE_TOTAL":3998261,"INODE_IDLE":"3997804","INODE_USED":"457","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.55","HOSTNAME":"jq-ddzj-1","KPI":"host_fs","MOUNT":"/dev/shm","FS_TOTAL":16003384,"FS_IDLE":"16003384","FS_USED":"0","FS_USAGE":"0","INODE_TOTAL":4000846,"INODE_IDLE":"4000845","INODE_USED":"1","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.55","HOSTNAME":"jq-ddzj-1","KPI":"host_fs","MOUNT":"/sys/fs/cgroup","FS_TOTAL":16003384,"FS_IDLE":"16003384","FS_USED":"0","FS_USAGE":"0","INODE_TOTAL":4000846,"INODE_IDLE":"4000833","INODE_USED":"13","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.55","HOSTNAME":"jq-ddzj-1","KPI":"host_fs","MOUNT":"/boot","FS_TOTAL":457938,"FS_IDLE":"355166","FS_USED":"102772","FS_USAGE":"0.23","INODE_TOTAL":128016,"INODE_IDLE":"127680","INODE_USED":"336","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.55","HOSTNAME":"jq-ddzj-1","KPI":"host_fs","MOUNT":"/tmp","FS_TOTAL":4750976,"FS_IDLE":"4730112","FS_USED":"20864","FS_USAGE":"0.01","INODE_TOTAL":327680,"INODE_IDLE":"327641","INODE_USED":"39","INODE_USAGE":"0.01"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.55","HOSTNAME":"jq-ddzj-1","KPI":"host_fs","MOUNT":"/usr","FS_TOTAL":4750976,"FS_IDLE":"3229676","FS_USED":"1521300","FS_USAGE":"0.33","INODE_TOTAL":327680,"INODE_IDLE":"295343","INODE_USED":"32337","INODE_USAGE":"0.1"},{"TIME":"2021-01-07 13:04:30","IP_ADDRESS":"10.222.55.54","HOSTNAME":"jq-ddzj-2","KPI":"host_fs","MOUNT":"/run/user/1506","FS_TOTAL":3200680,"FS_IDLE":"3200680","FS_USED":"0","FS_USAGE":"0","INODE_TOTAL":4000846,"INODE_IDLE":"4000845","INODE_USED":"1","INODE_USAGE":"0.01"}]