diff --git a/pastafaristats/send_info_daemon.py b/pastafaristats/send_info_daemon.py index 0d530be..e1dad49 100644 --- a/pastafaristats/send_info_daemon.py +++ b/pastafaristats/send_info_daemon.py @@ -98,10 +98,6 @@ def load_config(): def run(url, group=''): network_info=psutil.net_io_counters(pernic=False) - - #snetio(bytes_sent=508847144, bytes_recv=2664036642, packets_sent=1879739, packets_recv=2645451, errin=0, errout=0, dropin=0, dropout=0) - - net_info={'bytes_sent': network_info.bytes_sent, 'bytes_recv': network_info.bytes_recv, 'packets_sent': network_info.packets_sent, 'packets_recv': network_info.packets_recv} network_devices=psutil.net_if_addrs() @@ -118,22 +114,14 @@ def run(url, group=''): for disk in disk_info: partition=str(disk[1]) - #sdiskusage(total=234622398464, used=108806705152, free=113822973952, percent=48.9) - - disk_data=psutil.disk_usage(partition) - - partitions[partition]={'total': disk_data.total, 'used': disk_data.used, 'free': disk_data.free, 'percent': disk_data.percent} + partitions[partition]=psutil.disk_usage(partition) #print(partition+"="+str(partitions[partition])) dev_info={} - #svmem(total=16682799104, available=7034916864, percent=57.8, used=8982822912, free=2082840576, active=10260533248, inactive=3136503808, buffers=789561344, cached=4827574272, shared=319221760, slab=706420736) + mem_info=psutil.virtual_memory() - mem_data=psutil.virtual_memory() - - mem_info={'total': mem_data.total, 'available': mem_data.available, 'percent': mem_data.percent, 'used': mem_data.used, 'free': mem_data.free, 'active': mem_data.active, 'inactive': mem_data.inactive, 'buffers': mem_data.buffers, 'cached': mem_data.cached, 'shared': mem_data.shared, 'slab': mem_data.slab} - - obj_stats={'net_info': net_info, 'cpu_idle': cpu_idle, 'cpus_idle': cpus_idle, 'cpu_number': cpu_number, 'disks_info': partitions, 'mem_info': mem_info, 'hostname': hostname, 'group': group} + obj_stats={'net_info': network_info, 'cpu_idle': cpu_idle, 'cpus_idle': cpus_idle, 'cpu_number': cpu_number, 'disks_info': partitions, 'mem_info': mem_info, 'hostname': hostname, 'group': group} for module in modules_imported.values(): obj_stats=module.stat(obj_stats) diff --git a/setup.py b/setup.py index 2a2ad74..28d255e 100644 --- a/setup.py +++ b/setup.py @@ -5,11 +5,11 @@ import os from setuptools import setup, find_packages -if sys.version_info < (3, 8): - raise NotImplementedError("Sorry, you need at least Python 3.8 for use pastafaristats.") +if sys.version_info < (3, 6): + raise NotImplementedError("Sorry, you need at least Python 3.6 for use pastafaristats.") setup(name='pastafaristats', - version='1.0.3', + version='1.0.2', description='Simple scripts for send basic data of a server how complement to other stats solutions more complex.', author='Antonio de la Rosa Caballero', author_email='antonio.delarosa@coesinfo.com',