{"action":"created","issue":{"url":"https://api.github.com/repos/ProjectCloudly/Cloudly/issues/703","labels_url":"https://api.github.com/repos/ProjectCloudly/Cloudly/issues/703/labels{/name}","comments_url":"https://api.github.com/repos/ProjectCloudly/Cloudly/issues/703/comments","events_url":"https://api.github.com/repos/ProjectCloudly/Cloudly/issues/703/events","html_url":"https://github.com/ProjectCloudly/Cloudly/issues/703","id":126188841,"number":703,"title":"Bug in monitoring-agent _get_networking_stats","user":{"login":"sfrostick","id":10530102,"avatar_url":"https://avatars.githubusercontent.com/u/10530102?v=3","gravatar_id":"","url":"https://api.github.com/users/sfrostick","html_url":"https://github.com/sfrostick","followers_url":"https://api.github.com/users/sfrostick/followers","following_url":"https://api.github.com/users/sfrostick/following{/other_user}","gists_url":"https://api.github.com/users/sfrostick/gists{/gist_id}","starred_url":"https://api.github.com/users/sfrostick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfrostick/subscriptions","organizations_url":"https://api.github.com/users/sfrostick/orgs","repos_url":"https://api.github.com/users/sfrostick/repos","events_url":"https://api.github.com/users/sfrostick/events{/privacy}","received_events_url":"https://api.github.com/users/sfrostick/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ProjectCloudly/Cloudly/labels/admin","name":"admin","color":"bfdadc"},{"url":"https://api.github.com/repos/ProjectCloudly/Cloudly/labels/Agent","name":"Agent","color":"fad8c7"},{"url":"https://api.github.com/repos/ProjectCloudly/Cloudly/labels/BUG","name":"BUG","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"jparicka","id":870699,"avatar_url":"https://avatars.githubusercontent.com/u/870699?v=3","gravatar_id":"","url":"https://api.github.com/users/jparicka","html_url":"https://github.com/jparicka","followers_url":"https://api.github.com/users/jparicka/followers","following_url":"https://api.github.com/users/jparicka/following{/other_user}","gists_url":"https://api.github.com/users/jparicka/gists{/gist_id}","starred_url":"https://api.github.com/users/jparicka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jparicka/subscriptions","organizations_url":"https://api.github.com/users/jparicka/orgs","repos_url":"https://api.github.com/users/jparicka/repos","events_url":"https://api.github.com/users/jparicka/events{/privacy}","received_events_url":"https://api.github.com/users/jparicka/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2016-01-12T14:18:34Z","updated_at":"2016-01-12T18:00:00Z","closed_at":null,"body":"OS: Ubuntu 14.04\r\n\r\nError:\r\n```\r\nTraceback (most recent call last):\r\n  File \"/opt/monitoring-agent.py\", line 891, in <module>\r\n    main()\r\n  File \"/opt/monitoring-agent.py\", line 846, in main\r\n    system_metrics = get_system_metrics(UUID, SECRET)\r\n  File \"/opt/monitoring-agent.py\", line 790, in get_system_metrics\r\n    networking = _get_networking_stats()\r\n  File \"/opt/monitoring-agent.py\", line 616, in _get_networking_stats\r\n    input_accept_packets += int(line.split(' ')[0])\r\n```\r\nSeems to be caused by an issue parsing the output of iptables with fail2ban installed.\r\n\r\nOutput of iptables -L -vxn\r\n```\r\nChain INPUT (policy ACCEPT 40160126 packets, 6700360565 bytes)\r\n    pkts      bytes target     prot opt in     out     source               destination         \r\n    8120   684826 f2b-apache-xmlrpc  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 80,443\r\n    8120   684826 f2b-apache-wplogin  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 80,443\r\n  232380 12830364 f2b-sshd   tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 22\r\n\r\nChain FORWARD (policy ACCEPT 0 packets, 0 bytes)\r\n    pkts      bytes target     prot opt in     out     source               destination         \r\n\r\nChain OUTPUT (policy ACCEPT 19839195 packets, 1626340859 bytes)\r\n    pkts      bytes target     prot opt in     out     source               destination         \r\n\r\nChain blocked (0 references)\r\n    pkts      bytes target     prot opt in     out     source               destination         \r\n\r\nChain f2b-apache-wplogin (1 references)\r\n    pkts      bytes target     prot opt in     out     source               destination         \r\n    8120   684826 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           \r\n\r\nChain f2b-apache-xmlrpc (1 references)\r\n    pkts      bytes target     prot opt in     out     source               destination         \r\n    8120   684826 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           \r\n\r\nChain f2b-sshd (1 references)\r\n    pkts      bytes target     prot opt in     out     source               destination         \r\n  232380 12830364 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0\r\n```\r\n\r\nOutput of a print statement at line 616 -> print line.split(' ')\r\n\r\n```\r\n['', '', '231030', '12757476', 'f2b-sshd', '', '', 'tcp', '', '--', '', '*', '', '', '', '', '', '*', '', '', '', '', '', '', '0.0.0.0/0', '', '', '', '', '', '', '', '', '', '', '', '0.0.0.0/0', '', '', '', '', '', '', '', '', '', '', '', 'multiport', 'dports', '22']\r\n```\r\nThe first two elements of the array at blank so fails trying to parse the int here\r\n```\r\ninput_accept_packets += int(line.split(' ')[0])\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ProjectCloudly/Cloudly/issues/comments/170994929","html_url":"https://github.com/ProjectCloudly/Cloudly/issues/703#issuecomment-170994929","issue_url":"https://api.github.com/repos/ProjectCloudly/Cloudly/issues/703","id":170994929,"user":{"login":"jparicka","id":870699,"avatar_url":"https://avatars.githubusercontent.com/u/870699?v=3","gravatar_id":"","url":"https://api.github.com/users/jparicka","html_url":"https://github.com/jparicka","followers_url":"https://api.github.com/users/jparicka/followers","following_url":"https://api.github.com/users/jparicka/following{/other_user}","gists_url":"https://api.github.com/users/jparicka/gists{/gist_id}","starred_url":"https://api.github.com/users/jparicka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jparicka/subscriptions","organizations_url":"https://api.github.com/users/jparicka/orgs","repos_url":"https://api.github.com/users/jparicka/repos","events_url":"https://api.github.com/users/jparicka/events{/privacy}","received_events_url":"https://api.github.com/users/jparicka/received_events","type":"User","site_admin":false},"created_at":"2016-01-12T18:00:00Z","updated_at":"2016-01-12T18:00:00Z","body":"Thank you - I'll look into that."}}