|
|
|
@ -291,6 +291,9 @@ async def machine_info(bot: object, *args: str) -> str:
|
|
|
|
|
Return machine information.
|
|
|
|
|
"""
|
|
|
|
|
embed = Embed(type='rich')
|
|
|
|
|
supported_args = [
|
|
|
|
|
'network'
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
if not args:
|
|
|
|
|
embed.add_field(name='CPU', value=f'{Monitor.cpu_percent} %')
|
|
|
|
@ -300,4 +303,24 @@ async def machine_info(bot: object, *args: str) -> str:
|
|
|
|
|
embed.add_field(name='Disk used', value=f'{kbytes_to_gbytes(Monitor.disk_usage.used)} Gb')
|
|
|
|
|
embed.add_field(name='Disk free', value=f'{kbytes_to_gbytes(Monitor.disk_usage.free)} Gb')
|
|
|
|
|
|
|
|
|
|
if args[0] not in supported_args:
|
|
|
|
|
return await bot.send('The argument is not supported!')
|
|
|
|
|
|
|
|
|
|
if args[0] == 'network':
|
|
|
|
|
ios = Monitor.net_io_counters
|
|
|
|
|
|
|
|
|
|
for io in ios:
|
|
|
|
|
embed.clear_fields()
|
|
|
|
|
embed.add_field(name='Bytes received', value=ios[io].bytes_recv, inline=True)
|
|
|
|
|
embed.add_field(name='Bytes sent', value=ios[io].bytes_sent, inline=True)
|
|
|
|
|
embed.add_field(name='Packets received', value=ios[io].packets_recv, inline=True)
|
|
|
|
|
embed.add_field(name='Packets sent', value=ios[io].packets_sent, inline=True)
|
|
|
|
|
embed.add_field(name='Drop in', value=ios[io].dropin, inline=True)
|
|
|
|
|
embed.add_field(name='Drop out', value=ios[io].dropout, inline=True)
|
|
|
|
|
embed.add_field(name='Error in', value=ios[io].errin, inline=True)
|
|
|
|
|
embed.add_field(name='Error out', value=ios[io].errout, inline=True)
|
|
|
|
|
await bot.send(f'**`{io}`**', embed=embed)
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
return await bot.send('**`Monitor`**', embed=embed)
|
|
|
|
|