Project

General

Profile

Invite New Contacts Monkey - details

User documentation
09/21/2018

The daily ems_invite_monkey runs on .

The crontab for account ems contains:

45 6 * * 1-5 . /usr/local/etc/setups.sh && setup ems_monkey && ems_monkey invite --csvfile=/tmp/ems_maint_add-`date +\%Y\%m\%d`.csv

The code for the monkey is in the CVS repository (cdcvs.fnal.gov) in module ems/ems_monkey

The monkey uses the software stack Firefox<->geckodriver<->selenium.
  1. Firefox is installed on the system and maintained by the Linux Server Services group. **
    Note: The version of Firefox installed can be found by:
    - Start Firefox
    - Use the hamburger menu (upper right) to select 'Help'
    - Select 'About Firefox'
    
  2. Geckodriver is obtained from GitHub [[https://github.com/mozilla/geckodriver/releases]] and is intalled/maintain by the ems_monkey administrator. **
    Note:  The version of geckodriver installed can be found by:
    setup ems_monkey
    $EMS_MONKEY_DIR/bin/geckodriver -v
    
  3. Selenium is a Python module from PyPi: [[https://pypi.org/project/selenium/]] and is installed/updated by the Linux Server Services group.

Here is a page that highlights issues with getting the proper versions working together:
[[http://www.automationtestinghub.com/selenium-3-0-launch-firefox-with-geckodriver/]]

  1. Here is the list of options/flags for the command 'ems_invite_contacts:
    [ems@chkn1-prd ~]$ ems_monkey invite -?
    
    Run a monkeybot that will type the keystrokes to navigatge
    the manager GUI at manager.everbridge.net.
    
    Write periodic messages (and debugging messages, if "--debug" was specified)
    to the specified outfile (default: stdout).
    
    Don't send invites if "-n" is specified.
    
    Display a Firefox window if "--display=True" is given.
    
    If both --debug and --display=T are used, the monkey will drop into interactive
    python mode when either an exception or end-of-program occurs.  This will
    allow the Firefox developer tools to be used to inspect the web page and
    the python interpreter will be available to test Selenium commands.
    
    Usage:
    
           ems_monkey invite [--requiredOptions] [--options] [-flags]
    
    Where:
    
      --requiredOptions:
         --adminPassword=<value> # admin account password
              --adminUrl=<value> # URL for Mass Notification GUI
         --adminUsername=<value> # admin account used for accessing Mass Notification GUI
               --csvfile=<value> # Full path to the the CSV file that should be created and/or uploaded or ingested
    
      --options:
                         --debug # Print debugging info while running automation
                       --noemail # Do NOT send any summary email message at the end of the job
                     --noverbose # turn off verbosity (no screen messages unless there is an error, to silence the cron job)
               --display=<value> # If this option is present and has a value that evaluates to "True", use Firefox browser to display the automation (i.e. watch the monkey work). Use with --debug option to drop into interactive Python at the end of the program (i.e. when an exception is caught).  The Firefox developer tools can be used to examine the web page to understand why the monkey failed.
             --emailFrom=<value> # FNAL email address from whom the summary email should be sent
          --emailReplyTo=<value> # FNAL email address for the reply-to on the summary email
               --emailTo=<value> # FNAL email address to whom the summary email of job status should be sent
               --outfile=<value> # None
    
       -flags:
                              -n # Run automation, but don't send registration email invitation (used for testing)
    
    Synonymous Options:
        --admin-password=<value> # synonym for --adminPassword=<value>
             --admin-url=<value> # synonym for --adminUrl=<value>
        --admin-username=<value> # synonym for --adminUsername=<value>
        --admin_password=<value> # synonym for --adminPassword=<value>
             --admin_url=<value> # synonym for --adminUrl=<value>
        --admin_username=<value> # synonym for --adminUsername=<value>
            --email-from=<value> # synonym for --emailFrom=<value>
        --email-reply-to=<value> # synonym for --emailReplyTo=<value>
              --email-to=<value> # synonym for --emailTo=<value>
            --email_from=<value> # synonym for --emailFrom=<value>
        --email_reply_to=<value> # synonym for --emailReplyTo=<value>
              --email_to=<value> # synonym for --emailTo=<value>
    
    Required Data Types:
                         display : DataType('pyDataType.Boolean.Boolean') 
    
    You may omit "--adminPassword=<value>" if the $EMS_ADMIN_PASSWD environmental variable is set.
    You may omit "--adminUrl=<value>" if the $EMS_ADMIN_URL environmental variable is set.
    You may omit "--adminUsername=<value>" if the $EMS_ADMIN_USER environmental variable is set.
    You may omit "--emailFrom=<value>" if the $EMS_MAINT_EMAIL_FROM environmental variable is set.
    You may omit "--emailReplyTo=<value>" if the $EMS_MAINT_EMAIL_REPLY_TO environmental variable is set.
    You may omit "--emailTo=<value>" if the $EMS_MAINT_EMAIL_TO environmental variable is set.
    
    UNIX ExitStatus:
                         Success :   0
            Unhandled exceptions : 127
    
    

Files