Compare commits

..

2 commits

Author SHA1 Message Date
06acbf0dd9 New pastafari stats version 2024-02-11 12:58:41 +01:00
f1b57cbc03 Fixes in data 2024-02-11 02:02:57 +01:00
2 changed files with 18 additions and 6 deletions

View file

@ -99,6 +99,10 @@ 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()
cpu_idle=psutil.cpu_percent(interval=1)
@ -114,14 +118,22 @@ def run(url, group=''):
for disk in disk_info:
partition=str(disk[1])
partitions[partition]=psutil.disk_usage(partition)
#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}
#print(partition+"="+str(partitions[partition]))
dev_info={}
mem_info=psutil.virtual_memory()
#svmem(total=16682799104, available=7034916864, percent=57.8, used=8982822912, free=2082840576, active=10260533248, inactive=3136503808, buffers=789561344, cached=4827574272, shared=319221760, slab=706420736)
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}
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}
for module in modules_imported.values():
obj_stats=module.stat(obj_stats)

View file

@ -5,11 +5,11 @@ import os
from setuptools import setup, find_packages
if sys.version_info < (3, 6):
raise NotImplementedError("Sorry, you need at least Python 3.6 for use pastafaristats.")
if sys.version_info < (3, 8):
raise NotImplementedError("Sorry, you need at least Python 3.8 for use pastafaristats.")
setup(name='pastafaristats',
version='1.0.2',
version='1.0.3',
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',