checksubnets.py 文件源码

python
阅读 39 收藏 0 点赞 0 评论 0

项目:automation-scripts 作者: meraki 项目源码 文件源码
def printhelp():
    #prints help text

    printusertext('This is a script to send an email alert if APs are in invalid management subnets. The alert is')
    printusertext(' sent using a SMTP server; by  default Gmail. Use an automation platform like Zapier to read this email')
    printusertext(' and trigger further actions.')
    printusertext('')
    printusertext('To run the script, enter:')
    printusertext(' python checksubnets.py -k <key> -v <valid subs> [-u <user> -p <pass> -d <dest>] [-s <srv> -o <org>]')
    printusertext('')
    printusertext('Mandatory arguments:')
    printusertext(' -k <key>             : Your Meraki Dashboard API key')
    printusertext(' -v <valid subs>      : List of valid management subnets. Alert if management IP is not in these')
    printusertext('Arguments to enable sending emails. All three must be given to send email. If omitted, print to screen:')
    printusertext(' -u <user>            : The username (email address) that will be used to send the alert message')
    printusertext(' -p <pass>            : Password for the email address where the message is sent from')
    printusertext(' -d <dest>            : Recipient email address')
    printusertext('Optional arguments:')
    printusertext(' -s <server>          : Server to use for sending SMTP. If omitted, Gmail will be used')
    printusertext(' -o <org>             : Name of organization to be processed. If omitted, will process all organizations')
    printusertext('')
    printusertext('Defining subnets:')
    printusertext(' Parameter "-v <valid subs>" can take subnets in the following forms:')
    printusertext(' <subnet>/<mask>,<subnet>/<mask>,<subnet>/<mask>      Example: -v 192.168.128.0/24,10.10.0.0/16')
    printusertext(' file:<filename>                                      Example: -v file:validsubs.txt')
    printusertext('  <filename> is the name of a text file that defines the valid subnets. Enter one subnet per line')
    printusertext('  in the form <subnet>/<mask>')
    printusertext('')
    printusertext('To make script chaining easier, all lines containing informational messages to the user')
    printusertext(' start with the character @')
    printusertext('')
    printusertext('In Windows, use double quotes ("") to pass arguments containing spaces.')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号