-
Notifications
You must be signed in to change notification settings - Fork 0
/
home-sdwan.py
37 lines (28 loc) · 897 Bytes
/
home-sdwan.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python
#License upload using FORTIOSAPI from Github
# tested by TAS
# to get geoip POST to /geoip/geoip-query/select
import logging
import sys
import pdb
import pprint
from fortiosapi import FortiOSAPI
formatter = logging.Formatter(
'%(asctime)s %(name)-12s %(levelname)-8s %(message)s')
logger = logging.getLogger('fortiosapi')
hdlr = logging.FileHandler('testfortiosapi.log')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.DEBUG)
filename = 'config-fgt.txt'
def main():
vdom = "root"
fgt = FortiOSAPI()
fgt.login( '192.168.1.99', 'admin', 'tas19751975', verify=False)
hasil = fgt.monitor('virtual-wan', 'health-check' )
print ("----------------")
print (pprint.pprint(hasil['results']))
print ("----------------")
fgt.logout()
if __name__ == '__main__':
main()