Commits

Denis Khabarov  committed ad4edb1

modified: nagios_check_ncc_balance.py

  • Participants
  • Parent commits 5a4eb89

Comments (0)

Files changed (1)

File nagios_check_ncc_balance.py

 	try:
 		mybalance = lk.get_balance()
 	except ncc.QueryError as errstr:
-		print(errstr)
+		print('UNKNOWN Unable to get balance for ' + cliargs.user + '. Error: ' + str(errstr))
 		sys.exit(3)
         
 	if mybalance:
 		if cliargs.critical >= mybalance:
-			print('CRITICAL Balance = '+str(mybalance)+' RUB')
+			print('CRITICAL Balance for ' + cliargs.user + ' = ' + str(mybalance) + ' RUB')
 			sys.exit(2)
 		elif cliargs.warning >= mybalance:
-			print('WARNING Balance = '+str(mybalance)+' RUB')
+			print('WARNING Balance for ' + cliargs.user + '= ' + str(mybalance) + ' RUB')
 			sys.exit(1)
 		else:
-			print('OK. Balance = '+str(mybalance)+' RUB')
+			print('OK Balance for ' + cliargs.user + ' = ' + str(mybalance) + ' RUB')
 			sys.exit(0)
 	else:
-		print('UNKNOWN')
+		print('UNKNOWN Unable to get balance for ' + cliargs.user)
 		sys.exit(3)