Menu

#2 Optimize return codes/messages from looping for input/output

open-accepted
nobody
Improvement (1)
7
2010-12-20
2010-12-20
No

Actually, the actual code works fine. But it's out of good programming practices, becomming hard to read or manage.
Code:
return {"code": "WARNING", "message": "MRTG WARNING (" + bandwidth + " < threshold tolerance: " + str(traffic_threshold) + " b/s) - Input = " + str(traffic_current['input']) + " b/s, Output = " + str(traffic_current['output']) + " b/s"}
Maybe is better to modify the function nagios_return, to receive only vars, and an additional parameter for not show "code" in certain cases, extremely useful in functions like help() and usage().

Discussion

  • Leandro Toledo de Souza

    • summary: Fix return codes/messages from looping for input/output --> Optimize return codes/messages from looping for input/output
     
  • Leandro Toledo de Souza

    • labels: --> Improvement
    • status: open --> open-accepted
     

Log in to post a comment.

MongoDB Logo MongoDB