# Path: credentials.py
# VMWARE_VCENTER_USERNAME = "domain\\username"
# VMWARE_VCENTER_PASSWORD = "yourpassword"
# SNMP_COMMUNITY = "public"
# TINTRI_USER = "youraccount"
# TINTRI_PASSWORD = "yourpassword"
# WORKDESK_USER = 'youraccount'
# WORKDESK_PASSWORD = 'yourpassword'
# RUBRIK_USER = 'youraccount'
# RUBRIK_PASSWORD = 'yourpassword'
# NUTANIX_USER = 'youraccount'
# NUTANIX_PASSWORD = 'yourpassword'
# 
# Path: credentials.py
# VMWARE_VCENTER_USERNAME = "domain\\username"
# VMWARE_VCENTER_PASSWORD = "yourpassword"
# SNMP_COMMUNITY = "public"
# TINTRI_USER = "youraccount"
# TINTRI_PASSWORD = "yourpassword"
# WORKDESK_USER = 'youraccount'
# WORKDESK_PASSWORD = 'yourpassword'
# RUBRIK_USER = 'youraccount'
# RUBRIK_PASSWORD = 'yourpassword'
# NUTANIX_USER = 'youraccount'
# NUTANIX_PASSWORD = 'yourpassword'


import time
import json
import logging.config
import requests
import urllib3
from credentials import PRTG_USERNAME
from credentials import PRTG_PASSHASH
#!/usr/bin/env python
"""prtg_wan_1: module called query PRTG API for bandwidth statistics

NOTES:
* PRTG API is GET only and doesn't use sessions, so we pass the username and passhash on each connection.
* We're using the table.json function to retrieve multiple sensor values at once. We filter the results by
using a tag we've assigned to the sensors in PRTG called "statusboard_wan."

* The JSON output from this module is still formatted in the old iPad Statusboard app format:

{"graph":
    {"title": "WAN Bandwidth (mbps)", "type": "line", "refreshEveryNSeconds": 60,
    "datasequences": [
    {"title": "RAL",
        "datapoints": [{"title": "17:11", "value": 0.0}, {"title": "17:17", "value": 0.0}, ....
    {"title": "TRI",
        "datapoints": [{"title": "17:11", "value": 0.0}, {"title": "17:12", "value": 0.0}, ....

"""
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)


__author__ = 'scott@flakshack.com (Scott Vintinner)'

# =================================SETTINGS======================================
MAX_DATAPOINTS = 120
SAMPLE_INTERVAL = 15
GRAPH_TITLE = "WAN (mbps)"

# Path: credentials.py
# VMWARE_VCENTER_USERNAME = "domain\\username"
# VMWARE_VCENTER_PASSWORD = "yourpassword"
# SNMP_COMMUNITY = "public"
# TINTRI_USER = "youraccount"
# TINTRI_PASSWORD = "yourpassword"
# WORKDESK_USER = 'youraccount'
# WORKDESK_PASSWORD = 'yourpassword'
# RUBRIK_USER = 'youraccount'
# RUBRIK_PASSWORD = 'yourpassword'
# NUTANIX_USER = 'youraccount'
# NUTANIX_PASSWORD = 'yourpassword'
# 
# Path: credentials.py
# VMWARE_VCENTER_USERNAME = "domain\\username"
# VMWARE_VCENTER_PASSWORD = "yourpassword"
# SNMP_COMMUNITY = "public"
# TINTRI_USER = "youraccount"
# TINTRI_PASSWORD = "yourpassword"
# WORKDESK_USER = 'youraccount'
# WORKDESK_PASSWORD = 'yourpassword'
# RUBRIK_USER = 'youraccount'
# RUBRIK_PASSWORD = 'yourpassword'
# NUTANIX_USER = 'youraccount'
# NUTANIX_PASSWORD = 'yourpassword'


# Path: prtg_interface_1.py
import time
import json
import logging.config
import requests
import urllib3
from credentials import PRTG_USERNAME
from credentials import PRTG_PASSHASH

#!/usr/bin/env python
"""prtg_wan_1: module called query PRTG API for bandwidth statistics

NOTES:
* PRTG API is GET only and doesn't use sessions, so we pass the username and passhash on each connection.
* We're using the table.json function to retrieve multiple sensor values at once. We filter the results by
using a tag we've assigned to the sensors in PRTG called "statusboard_wan."

* The JSON output from this module is still formatted in the old iPad Statusboard app format:

{"graph":
    {"title": "WAN Bandwidth (mbps)", "type": "line", "refreshEveryNSeconds": 60,
    "datasequences": [
    {"title": "RAL",
        "datapoints": [{"title": "17:11", "value": 0.0}, {"title": "17:17", "value": 0.0}, ....
    {"title": "TRI",
        "datapoints": [{"title": "17:11", "value": 0.0}, {"title": "17:12", "value": 0.0}, ....

"""
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)


__author__ = 'scott@flakshack.com (Scott Vintinner)'

# =================================SETTINGS======================================
MAX_DATAPOINTS = 120
SAMPLE_INTERVAL = 15
GRAPH_TITLE = "WAN (mbps)"

PRTG_AUTH = "&username=" + PRTG_USERNAME + "&passhash=" + PRTG_PASSHASH