File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -580,34 +580,46 @@ def topProcessesStatus(request):
580580
581581 ## Memory
582582
583+ logging .CyberCPLogFileWriter .writeToFile (str (memory ))
584+
583585 if memory [3 ].find ('+' ) > - 1 :
584586 memoryFinal = memory [3 ].split ('+' )[0 ]
585587 else :
586588 memoryFinal = memory [3 ]
587589
588590 data ['totalMemory' ] = str (int (float (memoryFinal ) / 1024 )) + 'MB'
589591
592+
590593 ##
591594
592595 if memory [5 ].find ('free' ) > - 1 :
593596 data ['freeMemory' ] = str (int (float (memory [4 ]) / 1024 )) + 'MB'
594597 else :
595598 data ['freeMemory' ] = str (int (float (memory [5 ]) / 1024 )) + 'MB'
596599
600+
597601 ##
598602
599603 if memory [7 ].find ('used' ) > - 1 :
600604 data ['usedMemory' ] = str (int (float (memory [6 ]) / 1024 )) + 'MB'
601605 else :
602606 data ['usedMemory' ] = str (int (float (memory [7 ]) / 1024 )) + 'MB'
603607
604- if memory [9 ].find ('buff' ) > - 1 :
605- data ['buffCache' ] = str (int (float (memory [8 ]) / 1024 )) + 'MB'
606- else :
607- data ['buffCache' ] = str (int (float (memory [9 ]) / 1024 )) + 'MB'
608+
609+ try :
610+ if memory [9 ].find ('buff' ) > - 1 :
611+ data ['buffCache' ] = str (int (float (memory [8 ]) / 1024 )) + 'MB'
612+ else :
613+ data ['buffCache' ] = str (int (float (memory [9 ]) / 1024 )) + 'MB'
614+ except :
615+ logging .CyberCPLogFileWriter .writeToFile (memory [8 ])
616+ data ['buffCache' ] = str (int (float (memory [8 ].split ('+' )[0 ]) / 1024 )) + 'MB'
617+
608618
609619 ## Swap
610620
621+ logging .CyberCPLogFileWriter .writeToFile (str (swap ))
622+
611623
612624 data ['swapTotalMemory' ] = str (int (float (swap [2 ]) / 1024 )) + 'MB'
613625 data ['swapFreeMemory' ] = str (int (float (swap [4 ]) / 1024 )) + 'MB'
You can’t perform that action at this time.
0 commit comments