+#!/usr/bin/env python
+
+import sys
+try:
+ import ovh
+
+ [endpoint, application_key, application_secret, consumer_key, account] = sys.argv[1].split(",")
+ client = ovh.Client(
+ endpoint=endpoint,
+ application_key=application_key,
+ application_secret=application_secret,
+ consumer_key=consumer_key,
+ )
+
+ result = client.get('/sms/{}'.format(account))["creditsLeft"]
+
+ if result < 20:
+ print("SMS OVH Critical - Not enough sms left ({})|SMS {}".format(result, result))
+ sys.exit(2)
+ else:
+ print("SMS OVH Ok - Enough sms left ({})|SMS {}".format(result, result))
+ sys.exit(0)
+except Exception:
+ print("SMS OVH UNKNOWN - Error during script")
+ sys.exit(3)