├── .atlassian └── OWNER ├── logstash-plugin ├── Gemfile ├── Rakefile ├── NOTICE.TXT ├── logstash-output-jsm.gemspec ├── README.md └── spec │ └── outputs │ └── jsm_spec.rb ├── signal-sciences └── scripts │ ├── requests │ ├── packages │ │ ├── urllib3 │ │ │ ├── contrib │ │ │ │ └── __init__.py │ │ │ ├── packages │ │ │ │ ├── __init__.py │ │ │ │ └── ssl_match_hostname │ │ │ │ │ └── __init__.py │ │ │ ├── util │ │ │ │ ├── __init__.py │ │ │ │ ├── request.py │ │ │ │ └── response.py │ │ │ ├── filepost.py │ │ │ └── __init__.py │ │ ├── chardet │ │ │ ├── compat.py │ │ │ ├── __init__.py │ │ │ ├── constants.py │ │ │ ├── euctwprober.py │ │ │ ├── euckrprober.py │ │ │ ├── gb2312prober.py │ │ │ ├── big5prober.py │ │ │ ├── cp949prober.py │ │ │ ├── charsetprober.py │ │ │ ├── mbcsgroupprober.py │ │ │ ├── codingstatemachine.py │ │ │ ├── chardetect.py │ │ │ ├── utf8prober.py │ │ │ ├── escprober.py │ │ │ ├── sbcsgroupprober.py │ │ │ ├── mbcharsetprober.py │ │ │ └── eucjpprober.py │ │ └── __init__.py │ ├── certs.py │ ├── hooks.py │ ├── compat.py │ ├── __init__.py │ ├── exceptions.py │ ├── structures.py │ └── status_codes.py │ ├── README.md │ └── lambda.py ├── release ├── integration-builder │ ├── oem │ │ └── native │ │ │ ├── conffiles_deb │ │ │ ├── ogBefore.sh │ │ │ ├── control_deb │ │ │ └── ogAfter.sh │ ├── vcsa │ │ ├── native │ │ │ ├── conffiles_deb │ │ │ ├── ogBefore.sh │ │ │ ├── control_deb │ │ │ └── ogAfter.sh │ │ └── vcsa.gradle │ ├── version.json │ ├── opsview │ │ └── native │ │ │ ├── ogBefore.sh │ │ │ ├── control_deb │ │ │ └── ogAfter.sh │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── vcenter │ │ └── vcenter.gradle │ ├── gradlew.bat │ └── build.gradle └── jec-builder │ ├── jec-deb │ ├── DEBIAN │ │ ├── postinst │ │ ├── control │ │ └── preinst │ └── etc │ │ └── systemd │ │ └── system │ │ └── jec.service │ ├── jec-rpm │ ├── jec.service │ ├── rhel6-service │ │ └── jec │ └── SPECS │ │ ├── jec.spec │ │ └── jec-rhel6.spec │ ├── jec-win32 │ └── jecService.json.example │ ├── jec-win64 │ └── jecService.json.example │ └── version.json ├── zabbix ├── scripts │ ├── jsm_before.sh │ ├── jsm_after.sh │ └── action_command.txt ├── README.md └── conf │ ├── integration.conf │ └── jec-config.json ├── graylog-plugin ├── src │ ├── main │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── services │ │ │ │ └── org.graylog2.plugin.Plugin │ │ └── java │ │ │ └── com │ │ │ └── atlassian │ │ │ └── plugin │ │ │ └── graylog │ │ │ ├── JsmAlarmCallbackModule.java │ │ │ ├── JsmAlarmCallbackPlugin.java │ │ │ ├── alertapi │ │ │ ├── CreateAlertResponse.java │ │ │ └── CreateAlertRequest.java │ │ │ └── JsmAlarmCallbackMetaData.java │ └── deb │ │ └── control │ │ └── control └── README.md ├── labtech-email └── conf │ └── messageContent.txt ├── freshservice └── conf │ ├── addPrivateNote.json │ └── addPublicNote.json ├── .gitignore ├── jec ├── scripts │ ├── jec_action_executor.py │ └── http.py └── conf │ └── jec-config.json ├── catchpoint └── conf │ └── template.json ├── scalyr └── conf │ └── alertAddress.txt ├── prtg ├── conf │ ├── post-data.txt │ ├── post-data-v2.txt │ └── jec-config.json └── scripts │ └── jec_action_executor.py ├── microsoft-sentinel └── README.md ├── oem └── conf │ └── integration.conf ├── solarwinds-npm └── conf │ ├── reset-action-body.txt │ ├── jec-config.json │ └── trigger-action-body.txt ├── vcsa └── conf │ └── integration.conf ├── vcenter └── conf │ └── integration.conf ├── bmc-footprints-v11 └── conf │ ├── integration.conf │ └── jec-config.json ├── bmc-footprints-v12 └── conf │ ├── integration.conf │ └── jec-config.json ├── op5 ├── conf │ ├── integration.conf │ ├── jec-config.json │ └── jsm.cfg └── scripts │ └── jec_action_executor.py ├── icinga2 └── conf │ ├── integration.conf │ ├── jec-config.json │ └── jsm.conf ├── zenoss └── conf │ ├── integration.conf │ └── jec-config.json ├── icinga └── conf │ ├── integration.conf │ ├── jec-config.json │ └── jsm.cfg ├── nagios └── conf │ ├── integration.conf │ ├── jec-config.json │ └── jsm.cfg ├── nagios-xi └── conf │ ├── integration.conf │ └── jec-config.json ├── librenms ├── scripts │ └── transport.jsm.php └── conf │ └── jec-config.json ├── kayako └── conf │ └── triggerInstructions.txt ├── solarwinds-msp-n-central └── conf │ └── jec-config.json ├── logic-monitor └── conf │ └── alertData.txt ├── check_mk └── conf │ ├── jsm_api-v1_cmk-v2 │ └── jsm ├── bmc-remedy-force └── conf │ └── jsmClass.apxc ├── sales-force-service-cloud └── conf │ └── jsmClass.apxc ├── solarwinds-web-help-desk └── conf │ └── jec-config.json ├── connectwise-automate └── conf │ ├── AlertScript.ps1 │ └── JSMAlert.xml ├── manage-engine └── conf │ └── payload.json ├── bmc-remedy └── conf │ ├── jec-config.json │ └── integration.conf ├── CONTRIBUTING.md ├── jira-service-management └── conf │ └── jec-config.json ├── cherwell └── conf │ └── jec-config.json ├── README.md ├── trackit └── conf │ └── jec-config.json ├── amazon-security-hub └── conf │ ├── security-hub-template.json │ └── securityhub-outgoing-permission-template.json ├── jira-software └── conf │ └── jec-config.json ├── .github └── workflows │ ├── release-graylog-plugin.yml │ ├── release-without-jec-all.yml │ └── release-with-jec-all.yml ├── CODE_OF_CONDUCT.md └── zendesk └── conf └── triggerInstructions.md /.atlassian/OWNER: -------------------------------------------------------------------------------- 1 | nakyuz -------------------------------------------------------------------------------- /logstash-plugin/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | gemspec 3 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/urllib3/contrib/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /release/integration-builder/oem/native/conffiles_deb: -------------------------------------------------------------------------------- 1 | /etc/jsm/conf/integration.conf 2 | -------------------------------------------------------------------------------- /release/integration-builder/vcsa/native/conffiles_deb: -------------------------------------------------------------------------------- 1 | /etc/jsm/conf/integration.conf 2 | -------------------------------------------------------------------------------- /zabbix/scripts/jsm_before.sh: -------------------------------------------------------------------------------- 1 | if [ -z $(getent group jsm) ] 2 | then 3 | groupadd jsm 4 | fi -------------------------------------------------------------------------------- /graylog-plugin/src/main/resources/META-INF/services/org.graylog2.plugin.Plugin: -------------------------------------------------------------------------------- 1 | com.atlassian.plugin.graylog.JsmAlarmCallbackPlugin -------------------------------------------------------------------------------- /logstash-plugin/Rakefile: -------------------------------------------------------------------------------- 1 | @files=[] 2 | 3 | task :default do 4 | system("rake -T") 5 | end 6 | 7 | require "logstash/devutils/rake" 8 | -------------------------------------------------------------------------------- /release/integration-builder/version.json: -------------------------------------------------------------------------------- 1 | { 2 | "vcenter": "1.0.1", 3 | "vcsa": "1.0.1", 4 | "oem": "1.0.2", 5 | "opsview": "1.0.2" 6 | } 7 | -------------------------------------------------------------------------------- /release/integration-builder/opsview/native/ogBefore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ -z $(getent passwd jsm) ] 3 | then 4 | groupadd jsm -r 5 | useradd -g jsm jsm -r -d /var/jsm/ 6 | fi -------------------------------------------------------------------------------- /logstash-plugin/NOTICE.TXT: -------------------------------------------------------------------------------- 1 | Elasticsearch 2 | Copyright 2012-2015 Elasticsearch 3 | 4 | This product includes software developed by The Apache Software 5 | Foundation (http://www.apache.org/). -------------------------------------------------------------------------------- /release/integration-builder/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian/jsm-integration-scripts/HEAD/release/integration-builder/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /zabbix/README.md: -------------------------------------------------------------------------------- 1 | # Zabbix integration plugin for Jira Service Management 2 | 3 | :warning: If the feature isn't available on your site, keep checking Jira Service Management for updates. 4 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/urllib3/packages/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from . import ssl_match_hostname 4 | 5 | __all__ = ('ssl_match_hostname', ) 6 | -------------------------------------------------------------------------------- /graylog-plugin/src/deb/control/control: -------------------------------------------------------------------------------- 1 | Package: [[name]] 2 | Version: [[version]] 3 | Architecture: all 4 | Maintainer: Atlassian 5 | Section: web 6 | Priority: optional 7 | Depends: graylog-server | graylog-radio 8 | Description: [[description]] -------------------------------------------------------------------------------- /labtech-email/conf/messageContent.txt: -------------------------------------------------------------------------------- 1 | name:%NAME%,status:%STATUS%,clientName:%CLIENTNAME%,computerName:%COMPUTERNAME%,locationName:%LOCATIONNAME%,fieldName:%FIELDNAME%,result:%RESULT%,failCount:%FailCount%,when:%when%,contactName:%ContactName% 2 | -------------------------------------------------------------------------------- /release/integration-builder/oem/native/ogBefore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ -z $(getent passwd jsm) ] 3 | then 4 | groupadd jsm -r 5 | useradd -g jsm jsm -r -d /var/jsm/ 6 | fi 7 | 8 | if [ -z $(getent group jsm) ] 9 | then 10 | groupadd jsm 11 | fi 12 | -------------------------------------------------------------------------------- /release/integration-builder/vcsa/native/ogBefore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ -z $(getent passwd jsm) ] 3 | then 4 | groupadd jsm -r 5 | useradd -g jsm jsm -r -d /var/jsm/ 6 | fi 7 | 8 | if [ -z $(getent group jsm) ] 9 | then 10 | groupadd jsm 11 | fi 12 | -------------------------------------------------------------------------------- /release/jec-builder/jec-deb/DEBIAN/postinst: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | chown -R jec:jec /home/jsm 3 | chown -R jec:jec /var/log/jec 4 | 5 | chmod +x /etc/systemd/system/jec.service 6 | chmod +x /usr/local/bin/JiraEdgeConnector 7 | systemctl daemon-reload 8 | systemctl enable jec 9 | -------------------------------------------------------------------------------- /freshservice/conf/addPrivateNote.json: -------------------------------------------------------------------------------- 1 | { 2 | "freshdesk_webhook": { 3 | "ticket_id": "{{ticket.id}}", 4 | "ticket_tags": "{{ticket.tags}}", 5 | "ticket_latest_public_comment": "{{ticket.latest_public_comment}}", 6 | "triggered_event": "{note_type:private}" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /freshservice/conf/addPublicNote.json: -------------------------------------------------------------------------------- 1 | { 2 | "freshdesk_webhook": { 3 | "ticket_id": "{{ticket.id}}", 4 | "ticket_tags": "{{ticket.tags}}", 5 | "ticket_latest_public_comment": "{{ticket.latest_public_comment}}", 6 | "triggered_event": "ticket_action:note_type" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, build with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | .idea/* 15 | **/*.log 16 | **/*.iml -------------------------------------------------------------------------------- /release/integration-builder/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Jan 20 11:04:13 EET 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-all.zip 7 | -------------------------------------------------------------------------------- /release/integration-builder/oem/native/control_deb: -------------------------------------------------------------------------------- 1 | Package: [package-name] 2 | Version: [version] 3 | Architecture: all 4 | Description: [description] 5 | Depends: 6 | Vendor: Atlassian 7 | License: 'Apache 2.0' 8 | Section: default 9 | Priority: extra 10 | Homepage: http://www.atlassian.com 11 | Maintainer: Atlassian -------------------------------------------------------------------------------- /zabbix/scripts/jsm_after.sh: -------------------------------------------------------------------------------- 1 | chmod 755 /home/jsm/jec/scripts/send2jsm 2 | 3 | if id -u zabbix >/dev/null 2>&1; then 4 | usermod -a -G jsm zabbix 5 | chown -R zabbix:jsm /var/log/jec 6 | else 7 | echo "WARNING : zabbix user does not exist. Please don't forget to add your zabbix user to jsm group!" 8 | fi -------------------------------------------------------------------------------- /release/integration-builder/opsview/native/control_deb: -------------------------------------------------------------------------------- 1 | Package: [package-name] 2 | Version: [version] 3 | Architecture: all 4 | Description: [description] 5 | Depends: 6 | Vendor: Atlassian 7 | License: 'Apache 2.0' 8 | Section: default 9 | Priority: extra 10 | Homepage: http://www.atlassian.com 11 | Maintainer: Atlassian -------------------------------------------------------------------------------- /release/integration-builder/vcsa/native/control_deb: -------------------------------------------------------------------------------- 1 | Package: [package-name] 2 | Version: [version] 3 | Architecture: all 4 | Description: [description] 5 | Depends: 6 | Vendor: Atlassian 7 | License: 'Apache 2.0' 8 | Section: default 9 | Priority: extra 10 | Homepage: http://www.atlassian.com 11 | Maintainer: Atlassian -------------------------------------------------------------------------------- /release/jec-builder/jec-deb/DEBIAN/control: -------------------------------------------------------------------------------- 1 | Name: Jira Edge Connector (JEC) 2 | Description: Integration server for Connecting On-Premise Monitoring and ITSM Tools 3 | Website: https://www.atlassian.com 4 | Maintainer: Atlassian 5 | Package: %INTEGRATION% 6 | Section: %INTEGRATION% 7 | Version: %VERSION% 8 | Architecture: amd64 9 | -------------------------------------------------------------------------------- /release/jec-builder/jec-deb/DEBIAN/preinst: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ ! -d "/var/log/jec" ]; then 3 | mkdir /var/log/jec 4 | fi 5 | 6 | if [ ! -d "/home/jsm" ]; then 7 | mkdir /home/jsm 8 | fi 9 | 10 | if [ -z $(getent passwd jec) ]; then 11 | groupadd jec -r 12 | useradd -g jec jec -r -d /home/jsm 13 | fi 14 | -------------------------------------------------------------------------------- /release/integration-builder/vcsa/native/ogAfter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ! -d "/var/log/jsm" ]; then 4 | mkdir /var/log/jsm 5 | fi 6 | 7 | chmod -R 775 /var/log/jsm 8 | chmod -R g+s /var/log/jsm 9 | chmod -R 775 /etc/jsm 10 | 11 | chown -R jsm:jsm /etc/jsm 12 | chown -R jsm:jsm /var/log/jsm 13 | 14 | chmod 755 /etc/jsm/send2jsm 15 | 16 | 17 | -------------------------------------------------------------------------------- /release/jec-builder/jec-deb/etc/systemd/system/jec.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Jira Edge Connector (JEC) 3 | 4 | [Service] 5 | Group=jec 6 | User=jec 7 | Type=simple 8 | ExecStart=/usr/local/bin/JiraEdgeConnector 9 | 10 | Environment="JEC_CONF_SOURCE_TYPE=local" 11 | Environment="JEC_CONF_LOCAL_FILEPATH=/home/jsm/jec/conf/jec-config.json" 12 | 13 | [Install] 14 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /jec/scripts/jec_action_executor.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import json 3 | 4 | parser = argparse.ArgumentParser() 5 | parser.add_argument('-payload', '--payload', help='Payload from queue', required=True) 6 | 7 | args, unknown = parser.parse_known_args() 8 | args = vars(args) 9 | 10 | queue_message_string = args['payload'] 11 | queue_message = json.loads(queue_message_string) 12 | 13 | print(queue_message) -------------------------------------------------------------------------------- /release/jec-builder/jec-rpm/jec.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Jira Edge Connector (JEC) 3 | Wants=network-online.target 4 | After=network.target network-online.target 5 | 6 | [Service] 7 | Group=jec 8 | User=jec 9 | Type=simple 10 | ExecStart=/usr/local/bin/JiraEdgeConnector 11 | 12 | Environment="JEC_CONF_SOURCE_TYPE=local" 13 | Environment="JEC_CONF_LOCAL_FILEPATH=/home/jsm/jec/conf/jec-config.json" 14 | 15 | [Install] 16 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /catchpoint/conf/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "testName": "${TestName}", 3 | "testId": "${TestId}", 4 | "testUrl": "${TestUrl}", 5 | "alertTypeId": "${AlertTypeId}", 6 | "productName": "${ProductName}", 7 | "clientId": "${ClientId}", 8 | "notificationLevel": "${switch("${notificationLevelId}","0","WARNING","1","CRITICAL","3","OK")}", 9 | "nodeName":"${nodeDetails("${nodeName}")}", 10 | "nodeServerAddress":"${nodeDetails("${NodeServerAddress}")}" 11 | } 12 | -------------------------------------------------------------------------------- /signal-sciences/scripts/README.md: -------------------------------------------------------------------------------- 1 | This custom script is written for automatically adding an IP (taken from alert.details) to blacklist via Signal Sciences API, when a new alert is created. 2 | 3 | Configuration must be filled before running the file. 4 | * jsmAPIKey can be set as one's DefaultAPIKey or one can add a new API and set its apiKey. 5 | * SIGSCI_EMAIL and SIGSCI_PASSWORD are needed for providing authentication to Signal Sciences. One should enter their Signal Science credentials there. 6 | -------------------------------------------------------------------------------- /release/jec-builder/jec-win32/jecService.json.example: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "JEC Service", 3 | "DisplayName": "JEC Service", 4 | "Description": "Run the JEC Service", 5 | "JECPath" : "C:\\jsm\\jsm-jec\\JiraEdgeConnector32.exe", 6 | "Args" : ["-jec-metrics", "7070"], 7 | "Env": [ 8 | "JEC_CONF_LOCAL_FILEPATH=C:\\jsm\\jsm-jec\\conf\\jec-config.json", 9 | "JEC_CONF_SOURCE_TYPE=local" 10 | ], 11 | "Stderr": "C:\\jsm\\jsm-jec\\output\\jecErr.log", 12 | "Stdout": "C:\\jsm\\jsm-jec\\output\\jecOut.log" 13 | } -------------------------------------------------------------------------------- /release/jec-builder/jec-win64/jecService.json.example: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "JEC Service", 3 | "DisplayName": "JEC Service", 4 | "Description": "Run the JEC Service", 5 | "JECPath" : "C:\\jsm\\jsm-jec\\JiraEdgeConnector64.exe", 6 | "Args" : ["-jec-metrics", "7070"], 7 | "Env": [ 8 | "JEC_CONF_LOCAL_FILEPATH=C:\\jsm\\jsm-jec\\conf\\jec-config.json", 9 | "JEC_CONF_SOURCE_TYPE=local" 10 | ], 11 | "Stderr": "C:\\jsm\\jsm-jec\\output\\jecErr.log", 12 | "Stdout": "C:\\jsm\\jsm-jec\\output\\jecOut.log" 13 | } -------------------------------------------------------------------------------- /release/integration-builder/opsview/native/ogAfter.sh: -------------------------------------------------------------------------------- 1 | if [ ! -d "/var/log/jsm" ]; then 2 | mkdir /var/log/jsm 3 | fi 4 | chmod -R 775 /var/log/jsm 5 | chmod -R g+s /var/log/jsm 6 | 7 | chmod 755 /opt/jsm/opsview/monitoringscripts/notifications/send2jsm 8 | 9 | if id -u opsview >/dev/null 2>&1; then 10 | usermod -a -G jsm opsview 11 | chown -R opsview:jsm /var/log/jsm 12 | else 13 | echo "WARNING : opsview user does not exist. Please don't forget to add your opsview user to JSM group!" 14 | fi 15 | -------------------------------------------------------------------------------- /zabbix/scripts/action_command.txt: -------------------------------------------------------------------------------- 1 | /home/jsm/jec/scripts/send2jsm -triggerName='{TRIGGER.NAME}' -triggerId='{TRIGGER.ID}' -triggerStatus='{TRIGGER.STATUS}' -triggerSeverity='{TRIGGER.SEVERITY}' -triggerDescription='{TRIGGER.DESCRIPTION}' -triggerUrl='{TRIGGER.URL}' -triggerValue='{TRIGGER.VALUE}' -triggerHostGroupName='{TRIGGER.HOSTGROUP.NAME}' -hostName='{HOST.NAME}' -ipAddress='{IPADDRESS}' -eventId='{EVENT.ID}' -date='{DATE}' -time='{TIME}' -itemKey='{ITEM.KEY}' -itemValue='{ITEM.VALUE}' -recoveryEventStatus='{EVENT.RECOVERY.STATUS}' -------------------------------------------------------------------------------- /scalyr/conf/alertAddress.txt: -------------------------------------------------------------------------------- 1 | webhook-trigger:POST https://api.atlassian.com/jsm/ops/integration/v1/json/scalyr?apiKey=API_KEY[[{\"action\" : \"create\", \"trigger\" : \"#trigger#\", \"description\" : \"#description#\", \"title\" : \"#title#\", \"link\" : \"#link#\", \"id\" : \"#id#\"}]]&content-type=application/json, webhook-resolve:POST https://api.atlassian.com/jsm/ops/integration/v1/json/scalyr?apiKey=API_KEY[[{\"action\" : \"close\", \"trigger\" : \"#trigger#\", \"description\" : \"#description#\", \"title\" : \"#title#\", \"link\" : \"#link#\", \"id\" : \"#id#\"}]]&content-type=application/json -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py: -------------------------------------------------------------------------------- 1 | try: 2 | # Python 3.2+ 3 | from ssl import CertificateError, match_hostname 4 | except ImportError: 5 | try: 6 | # Backport of the function from a pypi module 7 | from backports.ssl_match_hostname import CertificateError, match_hostname 8 | except ImportError: 9 | # Our vendored copy 10 | from ._implementation import CertificateError, match_hostname 11 | 12 | # Not needed, but documenting what we provide. 13 | __all__ = ('CertificateError', 'match_hostname') 14 | -------------------------------------------------------------------------------- /release/integration-builder/oem/native/ogAfter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ! -d "/var/log/jsm" ]; then 4 | mkdir /var/log/jsm 5 | fi 6 | 7 | chmod -R 775 /var/log/jsm 8 | chmod -R g+s /var/log/jsm 9 | chmod -R 775 /etc/jsm 10 | 11 | chown -R jsm:jsm /etc/jsm 12 | chown -R jsm:jsm /var/log/jsm 13 | 14 | chmod 755 /etc/jsm/send2jsm 15 | 16 | if id -u oracle >/dev/null 2>&1; then 17 | usermod -a -G jsm oracle 18 | chown -R oracle:jsm /var/log/jsm 19 | else 20 | echo "WARNING : oracle user does not exist. Please don't forget to add your oracle user to jsm group!" 21 | fi 22 | -------------------------------------------------------------------------------- /prtg/conf/post-data.txt: -------------------------------------------------------------------------------- 1 | device=%device&linkdevice=%linkdevice&sitename=%sitename&serviceurl=%serviceurl&settings=%settings&datetime=%datetime&history=%history&host=%host&down=%down&downtime=%downtime&lastdown=%lastdown&nodename=%nodename&location=%location&group=%group&linkgroup=%linkgroup&lastmessage=%lastmessage&lastup=%lastup&uptime=%uptime&state=%state&statesince=%statesince&sensor=%sensor&linksensor=%linksensor&probe=%probe&priority=%priority&commentssensor=%commentssensor&commentsdevice=%commentsdevice&commentsgroup=%commentsgroup&commentsprobe=%commentsprobe&colorofstate=%colorofstate&iconofstate=%iconofstate&id=%sensorid& -------------------------------------------------------------------------------- /prtg/conf/post-data-v2.txt: -------------------------------------------------------------------------------- 1 | device=%device&linkdevice=%linkdevice&sitename=%sitename&serviceurl=%serviceurl&settings=%settings&datetime=%datetime&history=%history&host=%host&down=%down&downtime=%downtime&lastdown=%lastdown&nodename=%nodename&location=%location&group=%group&linkgroup=%linkgroup&lastmessage=%lastmessage&lastup=%lastup&uptime=%uptime&status=%status&statesince=%statesince&sensor=%sensor&linksensor=%linksensor&probe=%probe&priority=%priority&commentssensor=%commentssensor&commentsdevice=%commentsdevice&commentsgroup=%commentsgroup&commentsprobe=%commentsprobe&colorofstate=%colorofstate&iconofstate=%iconofstate&id=%sensorid& -------------------------------------------------------------------------------- /graylog-plugin/src/main/java/com/atlassian/plugin/graylog/JsmAlarmCallbackModule.java: -------------------------------------------------------------------------------- 1 | package com.atlassian.plugin.graylog; 2 | 3 | import org.graylog2.plugin.PluginConfigBean; 4 | import org.graylog2.plugin.PluginModule; 5 | 6 | import java.util.Collections; 7 | import java.util.Set; 8 | 9 | public class JsmAlarmCallbackModule extends PluginModule { 10 | @Override 11 | public Set getConfigBeans() { 12 | return Collections.emptySet(); 13 | } 14 | 15 | @Override 16 | protected void configure() { 17 | addAlarmCallback(JsmAlarmCallback.class); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /microsoft-sentinel/README.md: -------------------------------------------------------------------------------- 1 | Use the Microsoft Sentinel integration to create alerts in Jira Service Management (JSM) for incidents in Microsoft Sentinel. 2 | 3 | [![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fatlassian%2Fjsm-integration-scripts%2Fmaster%2Fmicrosoft-sentinel%2Fazuredeploy.json) 4 | [![Deploy to Azure Gov](https://aka.ms/deploytoazuregovbutton)](https://portal.azure.us/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fatlassian%2Fjsm-integration-scripts%2Fmaster%2Fmicrosoft-sentinel%2Fazuredeploy.json) -------------------------------------------------------------------------------- /oem/conf/integration.conf: -------------------------------------------------------------------------------- 1 | ######################################## OEM CONFIGURATION ####################################### 2 | apiKey= 3 | oem2jsm.logger=warning 4 | logPath=/var/log/jsm/oem2jsm.log 5 | #tags= 6 | #responders= 7 | 8 | ####################################### PROXY CONFIGURATION FOR OEM ############################################ 9 | oem2jsm.http.proxy.enabled=false 10 | oem2jsm.http.proxy.port=11111 11 | oem2jsm.http.proxy.host=localhost 12 | oem2jsm.http.proxy.protocol=http 13 | #oem2jsm.http.proxy.username=admin 14 | #oem2jsm.http.proxy.password=changeme -------------------------------------------------------------------------------- /solarwinds-npm/conf/reset-action-body.txt: -------------------------------------------------------------------------------- 1 | ## Reset action should trigger the Close Action of Jira Service Management. By default, Solarwinds Orion NPM integration alerts uses alias field as Alert Alias. 2 | That's why sending only ActionType (Close action's default condition) and alias (default alias of alerts) will be sufficient. 3 | 4 | ## Jira Service Management expects the following fields like below, use them without changing names. 5 | alias=${N=Alerting;M=AlertObjectID}-${N=Alerting;M=AlertID}&ActionType=Close 6 | 7 | ## Troubleshooting content, use µ#µ instead of = and §#§ instead of & 8 | aliasµ#µ${N=Alerting;M=AlertObjectID}-${N=Alerting;M=AlertID}§#§ActionTypeµ#µClose -------------------------------------------------------------------------------- /release/jec-builder/version.json: -------------------------------------------------------------------------------- 1 | { 2 | "jecVersion": "1.0.1", 3 | "icinga": "1.0.3", 4 | "icinga2": "1.0.4", 5 | "jec": "1.0.3", 6 | "nagios": "1.0.4", 7 | "nagios-xi": "1.0.3", 8 | "op5": "1.0.3", 9 | "prtg": "1.0.3", 10 | "solarwinds-msp-n-central": "1.0.3", 11 | "solarwinds-npm": "1.0.4", 12 | "solarwinds-web-help-desk": "1.0.3", 13 | "zenoss": "1.0.3", 14 | "zabbix": "1.0.4", 15 | "bmc-footprints-v11": "1.0.4", 16 | "bmc-footprints-v12": "1.0.3", 17 | "bmc-remedy": "1.0.4", 18 | "cherwell": "1.0.3", 19 | "jira-service-management": "1.0.5", 20 | "jira-software": "1.0.5", 21 | "trackit": "1.0.3", 22 | "librenms": "1.0.2" 23 | } 24 | -------------------------------------------------------------------------------- /zabbix/conf/integration.conf: -------------------------------------------------------------------------------- 1 | ######################################## ZABBIX CONFIGURATION ####################################### 2 | #zabbix2jsm.logger=warning 3 | logPath = /var/log/jec/send2jsm.log 4 | 5 | #responders= 6 | #tags= 7 | 8 | ####################################### PROXY CONFIGURATION FOR ZABBIX ############################################ 9 | zabbix2jsm.http.proxy.enabled = false 10 | zabbix2jsm.http.proxy.port = 11111 11 | zabbix2jsm.http.proxy.host = localhost 12 | zabbix2jsm.http.proxy.protocol = http 13 | #zabbix2jsm.http.proxy.username=admin 14 | #zabbix2jsm.http.proxy.password=changeme -------------------------------------------------------------------------------- /vcsa/conf/integration.conf: -------------------------------------------------------------------------------- 1 | ######################################## VCENTER VCSA CONFIGURATION ####################################### 2 | apiKey= 3 | vcsa2jsm.logger=warning 4 | logPath=/var/log/vcsa2jsm.log 5 | #tags= 6 | #responders= 7 | 8 | ####################################### PROXY CONFIGURATION FOR VCENTER############################################ 9 | vcsa2jsm.http.proxy.enabled=false 10 | vcsa2jsm.http.proxy.port=11111 11 | vcsa2jsm.http.proxy.host=localhost 12 | vcsa2jsm.http.proxy.protocol=http 13 | #vcsa2jsm.http.proxy.username=admin 14 | #vcsa2jsm.http.proxy.password=changeme 15 | -------------------------------------------------------------------------------- /graylog-plugin/src/main/java/com/atlassian/plugin/graylog/JsmAlarmCallbackPlugin.java: -------------------------------------------------------------------------------- 1 | package com.atlassian.plugin.graylog; 2 | 3 | import org.graylog2.plugin.Plugin; 4 | import org.graylog2.plugin.PluginMetaData; 5 | import org.graylog2.plugin.PluginModule; 6 | 7 | import java.util.Collection; 8 | import java.util.Collections; 9 | 10 | public class JsmAlarmCallbackPlugin implements Plugin { 11 | @Override 12 | public PluginMetaData metadata() { 13 | return new JsmAlarmCallbackMetaData(); 14 | } 15 | 16 | @Override 17 | public Collection modules() { 18 | return Collections.singletonList(new JsmAlarmCallbackModule()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vcenter/conf/integration.conf: -------------------------------------------------------------------------------- 1 | ######################################## VCENTER CONFIGURATION ####################################### 2 | apiKey= 3 | vcenter2jsm.logger=warning 4 | logPath=C:\jsm\vcenter2jsm.log 5 | #tags= 6 | #responders= 7 | 8 | ####################################### PROXY CONFIGURATION FOR VCENTER############################################ 9 | vcenter2jsm.http.proxy.enabled=false 10 | vcenter2jsm.http.proxy.port=11111 11 | vcenter2jsm.http.proxy.host=localhost 12 | vcenter2jsm.http.proxy.protocol=http 13 | #vcenter2jsm.http.proxy.username=admin 14 | #vcenter2jsm.http.proxy.password=changeme 15 | -------------------------------------------------------------------------------- /bmc-footprints-v11/conf/integration.conf: -------------------------------------------------------------------------------- 1 | #################################### BMCFOOTPRINTS CONFIGURATION ################################### 2 | bmcFootPrints2jsm.logger=warning 3 | logPath=/var/log/jec/send2jsm.log 4 | # If your OS is Windows then you can set logPath=C:\jsm-integration\send2jsm.log 5 | 6 | ####################################### PROXY CONFIGURATION FOR BMC FOOTPRINTS ############################################ 7 | bmcFootPrints2jsm.http.proxy.enabled=false 8 | bmcFootPrints2jsm.http.proxy.port=11111 9 | bmcFootPrints2jsm.http.proxy.host=localhost 10 | bmcFootPrints2jsm.http.proxy.protocol=http 11 | #bmcFootPrints2jsm.http.proxy.username=admin 12 | #bmcFootPrints2jsm.http.proxy.password=changeme -------------------------------------------------------------------------------- /bmc-footprints-v12/conf/integration.conf: -------------------------------------------------------------------------------- 1 | #################################### BMCFOOTPRINTS CONFIGURATION ################################### 2 | bmcFootPrints2jsm.logger=warning 3 | logPath=/var/log/jec/send2jsm.log 4 | # If your OS is Windows then you can set logPath=C:\jsm-integration\send2jsm.log 5 | 6 | ####################################### PROXY CONFIGURATION FOR BMC FOOTPRINTS ############################################ 7 | bmcFootPrints2jsm.http.proxy.enabled=false 8 | bmcFootPrints2jsm.http.proxy.port=11111 9 | bmcFootPrints2jsm.http.proxy.host=localhost 10 | bmcFootPrints2jsm.http.proxy.protocol=http 11 | #bmcFootPrints2jsm.http.proxy.username=admin 12 | #bmcFootPrints2jsm.http.proxy.password=changeme 13 | -------------------------------------------------------------------------------- /op5/conf/integration.conf: -------------------------------------------------------------------------------- 1 | ################################### NAGIOS2JSM CONFIGURATION ############################### 2 | #you can define log levels: warning, debug, info,error 3 | nagios2jsm.logger=warning 4 | nagios2jsm.timeout= 60 5 | logPath=/var/log/jec/send2jsm.log 6 | #responders= 7 | #tags= 8 | 9 | ####################################### PROXY CONFIGURATION FOR NAGIOS ############################################ 10 | nagios2jsm.http.proxy.enabled=false 11 | nagios2jsm.http.proxy.port=11111 12 | nagios2jsm.http.proxy.host=localhost 13 | nagios2jsm.http.proxy.protocol=http 14 | #nagios2jsm.http.proxy.username=admin 15 | #nagios2jsm.http.proxy.password=changeme 16 | 17 | -------------------------------------------------------------------------------- /icinga2/conf/integration.conf: -------------------------------------------------------------------------------- 1 | ################################### ICINGA2JSM CONFIGURATION ############################### 2 | #you can define log levels: warning, debug, info,error 3 | icinga2jsm.logger=warning 4 | icinga2jsm.timeout=60 5 | logPath=/var/log/jec/send2jsm.log 6 | #responders= 7 | #tags= 8 | 9 | ####################################### PROXY CONFIGURATION FOR ICINGA ############################################ 10 | icinga2jsm.http.proxy.enabled=false 11 | icinga2jsm.http.proxy.port=11111 12 | icinga2jsm.http.proxy.host=localhost 13 | icinga2jsm.http.proxy.protocol=http 14 | #icinga2jsm.http.proxy.username=admin 15 | #icinga2jsm.http.proxy.password=changeme 16 | 17 | -------------------------------------------------------------------------------- /zenoss/conf/integration.conf: -------------------------------------------------------------------------------- 1 | ################################### ZENOSS2JSM CONFIGURATION ############################### 2 | #you can define log levels: warning, debug, info,error 3 | zenoss2jsm.logger = warning 4 | zenoss2jsm.timeout = 60 5 | logPath = /var/log/jec/send2jsm.log 6 | #responders= 7 | #tags= 8 | 9 | ####################################### PROXY CONFIGURATION FOR ZENOSS ############################################ 10 | zenoss2jsm.http.proxy.enabled = false 11 | zenoss2jsm.http.proxy.port = 11111 12 | zenoss2jsm.http.proxy.host = localhost 13 | zenoss2jsm.http.proxy.protocol = http 14 | #zenoss2jsm.http.proxy.username=admin 15 | #zenoss2jsm.http.proxy.password=changeme -------------------------------------------------------------------------------- /icinga/conf/integration.conf: -------------------------------------------------------------------------------- 1 | ################################### ICINGA2JSM CONFIGURATION ############################### 2 | #you can define log levels: warning, debug, info,error 3 | icinga2jsm.logger = warning 4 | icinga2jsm.timeout = 60 5 | logPath = /var/log/jec/send2jsm.log 6 | #responders= 7 | #tags= 8 | 9 | 10 | ####################################### PROXY CONFIGURATION FOR ICINGA ############################################ 11 | icinga2jsm.http.proxy.enabled = false 12 | icinga2jsm.http.proxy.port = 11111 13 | icinga2jsm.http.proxy.host = localhost 14 | icinga2jsm.http.proxy.protocol = http 15 | #icinga2jsm.http.proxy.username=admin 16 | #icinga2jsm.http.proxy.password=changeme 17 | -------------------------------------------------------------------------------- /nagios/conf/integration.conf: -------------------------------------------------------------------------------- 1 | ################################### NAGIOS2JSM CONFIGURATION ############################### 2 | #you can define log levels: warning, debug, info,error 3 | nagios2jsm.logger = warning 4 | nagios2jsm.timeout = 60 5 | logPath = /var/log/jec/send2jsm.log 6 | #responders= 7 | #tags= 8 | 9 | 10 | ####################################### PROXY CONFIGURATION FOR NAGIOS ############################################ 11 | nagios2jsm.http.proxy.enabled = false 12 | nagios2jsm.http.proxy.port = 11111 13 | nagios2jsm.http.proxy.host = localhost 14 | nagios2jsm.http.proxy.protocol = http 15 | #nagios2jsm.http.proxy.username=admin 16 | #nagios2jsm.http.proxy.password=changeme 17 | -------------------------------------------------------------------------------- /nagios-xi/conf/integration.conf: -------------------------------------------------------------------------------- 1 | ################################### NAGIOS2JSM CONFIGURATION ############################### 2 | #you can define log levels: warning, debug, info,error 3 | nagios2jsm.logger = warning 4 | nagios2jsm.timeout = 60 5 | logPath = /var/log/jec/send2jsm.log 6 | #responders= 7 | #tags= 8 | 9 | 10 | ####################################### PROXY CONFIGURATION FOR NAGIOS ############################################ 11 | nagios2jsm.http.proxy.enabled = false 12 | nagios2jsm.http.proxy.port = 11111 13 | nagios2jsm.http.proxy.host = localhost 14 | nagios2jsm.http.proxy.protocol = http 15 | #nagios2jsm.http.proxy.username=admin 16 | #nagios2jsm.http.proxy.password=changeme 17 | -------------------------------------------------------------------------------- /graylog-plugin/src/main/java/com/atlassian/plugin/graylog/alertapi/CreateAlertResponse.java: -------------------------------------------------------------------------------- 1 | package com.atlassian.plugin.graylog.alertapi; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | public class CreateAlertResponse { 6 | 7 | @JsonProperty("result") 8 | private String result; 9 | 10 | @JsonProperty("requestId") 11 | private String requestId; 12 | 13 | public String getResult() { 14 | return result; 15 | } 16 | 17 | public void setResult(String result) { 18 | this.result = result; 19 | } 20 | 21 | public String getRequestId() { 22 | return requestId; 23 | } 24 | 25 | public void setRequestId(String requestId) { 26 | this.requestId = requestId; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/certs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | requests.certs 6 | ~~~~~~~~~~~~~~ 7 | 8 | This module returns the preferred default CA certificate bundle. 9 | 10 | If you are packaging Requests, e.g., for a Linux distribution or a managed 11 | environment, you can change the definition of where() to return a separately 12 | packaged CA bundle. 13 | """ 14 | import os.path 15 | 16 | try: 17 | from certifi import where 18 | except ImportError: 19 | def where(): 20 | """Return the preferred certificate bundle.""" 21 | # vendored bundle inside Requests 22 | return os.path.join(os.path.dirname(__file__), 'cacert.pem') 23 | 24 | if __name__ == '__main__': 25 | print(where()) 26 | -------------------------------------------------------------------------------- /librenms/scripts/transport.jsm.php: -------------------------------------------------------------------------------- 1 | $url = $opts['url']; 2 | 3 | $curl = curl_init(); 4 | 5 | set_curl_proxy($curl); 6 | curl_setopt($curl, CURLOPT_URL, $url ); 7 | curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST"); 8 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); 9 | curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); 10 | curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($obj)); 11 | 12 | $ret = curl_exec($curl); 13 | $code = curl_getinfo($curl, CURLINFO_HTTP_CODE); 14 | 15 | var_dump("Response from JSM: " . $ret); //FIXME: proper debugging 16 | 17 | if($code != 200) { 18 | var_dump("Error when sending post request to JSM. Response code: " . $code); //FIXME: proper debugging 19 | return false; 20 | } 21 | 22 | return true; 23 | -------------------------------------------------------------------------------- /kayako/conf/triggerInstructions.txt: -------------------------------------------------------------------------------- 1 | - From the "Triggers" page, click "New trigger". 2 | - Put "Jira Service Management - Create Alert" into "Rule title". 3 | - Under "When these conditions are met: ", add the conditions as specified below: 4 | - Conversations:Status equal to New 5 | - Under "Perform the following actions:", select the Endpoint that you created. 6 | - Click "Save". 7 | 8 | - After the trigger is saved, click "New trigger" to add the second trigger. 9 | - Put "Jira Service Management - Close Alert" into "Rule title". 10 | - Under "Meet any of the following conditions:", add two conditions as specified below: 11 | - Conversations:Status changed to Completed 12 | - Conversations:Status equal to Completed 13 | - Under "Perform the following actions:", select the Endpoint that you created. 14 | - Click "Save". -------------------------------------------------------------------------------- /op5/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [], 6 | "globalFlags": { 7 | "url": "", 8 | "username": "", 9 | "password": "" 10 | }, 11 | "actionMappings": { 12 | "acknowledge": { 13 | "filepath": "", 14 | "sourceType": "", 15 | "env": [], 16 | "stdout": "" 17 | } 18 | }, 19 | "pollerConf": { 20 | "pollingWaitIntervalInMillis": 100, 21 | "visibilityTimeoutInSec": 30, 22 | "maxNumberOfMessages": 10 23 | }, 24 | "poolConf": { 25 | "maxNumberOfWorker": 12, 26 | "minNumberOfWorker": 4, 27 | "monitoringPeriodInMillis": 15000, 28 | "keepAliveTimeInMillis": 6000, 29 | "queueSize": 0 30 | } 31 | } -------------------------------------------------------------------------------- /prtg/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [], 6 | "globalFlags": { 7 | "prtgUrl": "", 8 | "username": "", 9 | "passhash": "" 10 | }, 11 | "actionMappings": { 12 | "acknowledgeSensor": { 13 | "filepath": "", 14 | "sourceType": "", 15 | "env": [], 16 | "stdout": "" 17 | } 18 | }, 19 | "pollerConf": { 20 | "pollingWaitIntervalInMillis": 100, 21 | "visibilityTimeoutInSec": 30, 22 | "maxNumberOfMessages": 10 23 | }, 24 | "poolConf": { 25 | "maxNumberOfWorker": 12, 26 | "minNumberOfWorker": 4, 27 | "monitoringPeriodInMillis": 15000, 28 | "keepAliveTimeInMillis": 6000, 29 | "queueSize": 0 30 | } 31 | } -------------------------------------------------------------------------------- /solarwinds-msp-n-central/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [], 6 | "globalFlags": { 7 | "url": "", 8 | "username": "", 9 | "password": "" 10 | }, 11 | "actionMappings": { 12 | "acknowledgeNotification": { 13 | "filepath": "", 14 | "sourceType": "", 15 | "env": [], 16 | "stdout": "" 17 | } 18 | }, 19 | "pollerConf": { 20 | "pollingWaitIntervalInMillis": 100, 21 | "visibilityTimeoutInSec": 30, 22 | "maxNumberOfMessages": 10 23 | }, 24 | "poolConf": { 25 | "maxNumberOfWorker": 12, 26 | "minNumberOfWorker": 4, 27 | "monitoringPeriodInMillis": 15000, 28 | "keepAliveTimeInMillis": 6000, 29 | "queueSize": 0 30 | } 31 | } -------------------------------------------------------------------------------- /zabbix/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [], 6 | "globalFlags": { 7 | "command_url": "http://localhost/zabbix/api_jsonrpc.php", 8 | "user": "Admin", 9 | "password": "zabbix" 10 | }, 11 | "actionMappings": { 12 | "Acknowledge": { 13 | "filepath": "", 14 | "sourceType": "", 15 | "env": [], 16 | "stdout": "" 17 | } 18 | }, 19 | "pollerConf": { 20 | "pollingWaitIntervalInMillis": 100, 21 | "visibilityTimeoutInSec": 30, 22 | "maxNumberOfMessages": 10 23 | }, 24 | "poolConf": { 25 | "maxNumberOfWorker": 12, 26 | "minNumberOfWorker": 4, 27 | "monitoringPeriodInMillis": 15000, 28 | "keepAliveTimeInMillis": 6000, 29 | "queueSize": 0 30 | } 31 | } -------------------------------------------------------------------------------- /jec/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [ 6 | "" 7 | ], 8 | "globalFlags": { 9 | }, 10 | "actionMappings": { 11 | "postActionToJEC": { 12 | "filepath": "", 13 | "sourceType": "", 14 | "env": [ 15 | "e1=v1", 16 | "e2=v2" 17 | ], 18 | "stdout": "" 19 | } 20 | }, 21 | "pollerConf": { 22 | "pollingWaitIntervalInMillis": 100, 23 | "visibilityTimeoutInSec": 30, 24 | "maxNumberOfMessages": 10 25 | }, 26 | "poolConf": { 27 | "maxNumberOfWorker": 12, 28 | "minNumberOfWorker": 4, 29 | "monitoringPeriodInMillis": 15000, 30 | "keepAliveTimeInMillis": 6000, 31 | "queueSize": 0 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/hooks.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests.hooks 5 | ~~~~~~~~~~~~~~ 6 | 7 | This module provides the capabilities for the Requests hooks system. 8 | 9 | Available hooks: 10 | 11 | ``response``: 12 | The response generated from a Request. 13 | """ 14 | HOOKS = ['response'] 15 | 16 | 17 | def default_hooks(): 18 | return dict((event, []) for event in HOOKS) 19 | 20 | # TODO: response is the only one 21 | 22 | 23 | def dispatch_hook(key, hooks, hook_data, **kwargs): 24 | """Dispatches a hook dictionary on a given piece of data.""" 25 | hooks = hooks or dict() 26 | hooks = hooks.get(key) 27 | if hooks: 28 | if hasattr(hooks, '__call__'): 29 | hooks = [hooks] 30 | for hook in hooks: 31 | _hook_data = hook(hook_data, **kwargs) 32 | if _hook_data is not None: 33 | hook_data = _hook_data 34 | return hook_data 35 | -------------------------------------------------------------------------------- /release/integration-builder/vcenter/vcenter.gradle: -------------------------------------------------------------------------------- 1 | task prepareVCenter() << { 2 | def destination = "${project.buildDir}/jsm" 3 | copy { 4 | from "${project.buildDir}/jsm-integration" 5 | into "${destination}/jsm-integration" 6 | } 7 | 8 | copy { 9 | from "${project.projectDir}/vcenter/scripts/send2jsm.go" 10 | into "${destination}/jsm" 11 | } 12 | 13 | copy { 14 | from "${project.projectDir}/vcenter/scripts/send2jsm.exe" 15 | into "${destination}/jsm" 16 | } 17 | 18 | copy { 19 | from "${project.projectDir}/vcenter/conf/integration.conf" 20 | into "${destination}/jsm/jsm-integration/conf" 21 | } 22 | } 23 | task packageVCenterZip(dependsOn: 'prepareVCenter', type: Zip) { 24 | from "${project.buildDir}/jsm" 25 | baseName = 'jsm-vcenter' 26 | version = project.ext.versions.vcenter + project.ext.versionSuffix 27 | 28 | 29 | } 30 | task vcenter(dependsOn: ['packageVCenterZip']) 31 | -------------------------------------------------------------------------------- /release/jec-builder/jec-rpm/rhel6-service/jec: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # description: Jira Edge Connector (JEC) 4 | # 5 | # Below is the source function library 6 | # 7 | . /etc/init.d/functions 8 | 9 | exec="/usr/local/bin/JiraEdgeConnector" 10 | prog="JEC" 11 | config="/home/jsm/jec/conf/jec-config.json" 12 | 13 | export JEC_CONF_SOURCE_TYPE="local" 14 | export JEC_CONF_LOCAL_FILEPATH="/home/jsm/jec/conf/jec-config.json" 15 | 16 | start() { 17 | echo -n "Starting Jira Edge Connector (JEC)" 18 | $exec 19 | } 20 | 21 | stop() { 22 | echo -n "Stopping Jira Edge Connector (JEC)" 23 | kill -15 $(pgrep -f JiraEdgeConnector) 24 | } 25 | 26 | 27 | case "$1" in 28 | start) 29 | start 30 | ;; 31 | stop) 32 | stop 33 | ;; 34 | restart) 35 | echo -n "Restarting Jira Edge Connector (JEC)" 36 | stop 37 | start 38 | ;; 39 | *) 40 | echo "Usage: $0 {start|stop|restart}" 41 | exit 1 42 | ;; 43 | esac -------------------------------------------------------------------------------- /librenms/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [], 6 | "globalFlags": { 7 | "url": "", 8 | "apiToken": "" 9 | }, 10 | "actionMappings": { 11 | "ackAlert": { 12 | "filepath": "", 13 | "sourceType": "", 14 | "env": [], 15 | "stdout": "" 16 | }, 17 | "unmuteAlert": { 18 | "filepath": "", 19 | "sourceType": "", 20 | "env": [], 21 | "stdout": "" 22 | } 23 | }, 24 | "pollerConf": { 25 | "pollingWaitIntervalInMillis": 100, 26 | "visibilityTimeoutInSec": 30, 27 | "maxNumberOfMessages": 10 28 | }, 29 | "poolConf": { 30 | "maxNumberOfWorker": 12, 31 | "minNumberOfWorker": 4, 32 | "monitoringPeriodInMillis": 15000, 33 | "keepAliveTimeInMillis": 6000, 34 | "queueSize": 0 35 | } 36 | } -------------------------------------------------------------------------------- /logic-monitor/conf/alertData.txt: -------------------------------------------------------------------------------- 1 | service=##SERVICE##&alertid=##ALERTID##&alerttype=##ALERTTYPE##&alertstatus=##ALERTSTATUS##&level=##LEVEL##&host=##HOST##&datasource=##DATASOURCE##&eventsource=##EVENTSOURCE##&batchjob=##BATCHJOB##&group=##GROUP##&datapoint=##DATAPOINT##&start=##START##&finish=##FINISH##&duration=##DURATION##&value=##VALUE##&threshold=##THRESHOLD##&userdata=##USERDATA##&cmdline=##CMDLINE##&exitCode=##EXITCODE##&stdout=##STDOUT##&stderr=##STDERR##&agent=##AGENT_DESCRIPTION##&checkpoint=##CHECKPOINT##&datapointdesc=##DPDESCRIPTION##&hostdesc=##HOSTDESCRIPTION##&hostinfo=##system.sysinfo##&hostips=##system.ips##&hosturl=##DEVICEURL##&instance=##INSTANCE##&dsidesc=##DSIDESCRIPTION##&batchdesc=##BJDESCRIPTION##&dsdesc=##DSDESCRIPTION##&eventmsg=##LIMITEDMESSAGE##&eventlogmsg=##MESSAGE##&eventcode=##EVENTCODE##&eventtype=##TYPE##&eventuser=##USER##&eventlogfile=##LOGFILE##&eventsource=##SOURCENAME##&servicedetail=##DETAIL##&serviceurl=##URL##&servicegroup=##SERVICEGROUP##&date=##DATE##&clearvalue=##CLEARVALUE##&hostname=##system.hostname## -------------------------------------------------------------------------------- /check_mk/conf/jsm_api-v1_cmk-v2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # JSM_APIv1_CMKv2 3 | 4 | import json 5 | import os 6 | import requests 7 | 8 | def main(): 9 | header_type = {'Content-Type':'application/json'} 10 | context = dict([(var[7:], value) 11 | for (var, value) in os.environ.items() 12 | if var.startswith("NOTIFY_")]) 13 | 14 | if "PARAMETER_1" in context: 15 | jsm_api_url = context["PARAMETER_1"] 16 | 17 | if "PARAMETER_1" in context.keys(): 18 | del context["PARAMETER_1"] 19 | if "PARAMETERS" in context.keys(): 20 | del context["PARAMETERS"] 21 | else: 22 | return "No API Key Specified." 23 | 24 | try: 25 | req = requests.post(jsm_api_url, headers=header_type, data=json.dumps(context)) 26 | is_success = True 27 | except: 28 | is_success = False 29 | 30 | if is_success: 31 | return "Script finished successfully." 32 | else: 33 | return "Script failed." 34 | 35 | main() 36 | -------------------------------------------------------------------------------- /bmc-remedy-force/conf/jsmClass.apxc: -------------------------------------------------------------------------------- 1 | global class jsmClass { 2 | @future(callout=true) 3 | WebService static void xRESTCall(String endpoint, String payload){ 4 | HttpRequest req = new HttpRequest(); 5 | req.setEndpoint(endpoint); 6 | req.setMethod('POST'); 7 | req.setBody(payload); 8 | req.setHeader( 'Content-Type', 'application/json' ); 9 | Http http = new Http(); 10 | HTTPResponse res = http.send(req); 11 | System.debug(' Response: ' + res.getBody()); 12 | } 13 | global static string getPayloadStringByHandlingNull(String value){ 14 | return value==null?null:'"'+value.replaceAll('[^a-zA-Z0-9\s]', '').replaceAll('\\s+', ' ')+'"'; 15 | } 16 | global static string getPayloadStringByHandlingNull(DateTime value){ 17 | return value==null?null:'"'+value+'"'; 18 | } 19 | global static string getPayloadStringByHandlingNull(Decimal value){ 20 | return value==null?null:'"'+value+'"'; 21 | } 22 | global static string getPayloadStringByHandlingNull(Boolean value){ 23 | return value==null?null:'"'+value+'"'; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /check_mk/conf/jsm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # Jira Service Management 3 | 4 | import json 5 | import os 6 | import urllib2 7 | 8 | 9 | def main(): 10 | context = dict([(var[7:], value.decode("utf-8")) 11 | for (var, value) in os.environ.items() 12 | if var.startswith("NOTIFY_")]) 13 | 14 | if "PARAMETER_1" in context: 15 | jsm_api_url = context["PARAMETER_1"] 16 | 17 | if "PARAMETER_1" in context.keys(): 18 | del context["PARAMETER_1"] 19 | if "PARAMETERS" in context.keys(): 20 | del context["PARAMETERS"] 21 | else: 22 | return "No API Key Specified." 23 | 24 | req = urllib2.Request(url=jsm_api_url) 25 | req.add_header('Content-Type', 'application/json') 26 | 27 | try: 28 | urllib2.urlopen(req, json.dumps(context)) 29 | is_success = True 30 | except: 31 | is_success = False 32 | 33 | if is_success: 34 | return "Script finished successfully." 35 | else: 36 | return "Script failed." 37 | 38 | main() 39 | -------------------------------------------------------------------------------- /sales-force-service-cloud/conf/jsmClass.apxc: -------------------------------------------------------------------------------- 1 | global class jsmClass { 2 | @future(callout=true) 3 | WebService static void xRESTCall(String endpoint, String payload){ 4 | HttpRequest req = new HttpRequest(); 5 | req.setEndpoint(endpoint); 6 | req.setMethod('POST'); 7 | req.setBody(payload); 8 | req.setHeader( 'Content-Type', 'application/json' ); 9 | Http http = new Http(); 10 | HTTPResponse res = http.send(req); 11 | System.debug(' Response: ' + res.getBody()); 12 | } 13 | global static string getPayloadStringByHandlingNull(String value){ 14 | return value==null?null:'"'+value.replaceAll('[^a-zA-Z0-9\\s\\-]', '').replaceAll('\\s+', ' ')+'"'; 15 | } 16 | global static string getPayloadStringByHandlingNull(DateTime value){ 17 | return value==null?null:'"'+value+'"'; 18 | } 19 | global static string getPayloadStringByHandlingNull(Decimal value){ 20 | return value==null?null:'"'+value+'"'; 21 | } 22 | global static string getPayloadStringByHandlingNull(Boolean value){ 23 | return value==null?null:'"'+value+'"'; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /zenoss/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [], 6 | "globalFlags": { 7 | "command_url": "http://localhost:8080/zport/dmd/evconsole_router", 8 | "username": "Admin", 9 | "password": "zenoss" 10 | }, 11 | "actionMappings": { 12 | "Acknowledge": { 13 | "filepath": "", 14 | "sourceType": "", 15 | "env": [], 16 | "stdout": "" 17 | }, 18 | "Close": { 19 | "filepath": "", 20 | "sourceType": "", 21 | "env": [], 22 | "stdout": "" 23 | } 24 | }, 25 | "pollerConf": { 26 | "pollingWaitIntervalInMillis": 100, 27 | "visibilityTimeoutInSec": 30, 28 | "maxNumberOfMessages": 10 29 | }, 30 | "poolConf": { 31 | "maxNumberOfWorker": 12, 32 | "minNumberOfWorker": 4, 33 | "monitoringPeriodInMillis": 15000, 34 | "keepAliveTimeInMillis": 6000, 35 | "queueSize": 0 36 | } 37 | } -------------------------------------------------------------------------------- /graylog-plugin/README.md: -------------------------------------------------------------------------------- 1 | # Graylog integration plugin for Jira Service Management 2 | 3 | Jira Service Management offers an integration plugin for Graylog. Graylog can use this plugin to send stream alerts to Jira Service Management with detailed information. Jira Service Management acts as a dispatcher for Graylog alerts, determining the right people to notify based on their on-call schedules via email, text messages (SMS), phone calls, and push notifications (both iPhone & Android), and by escalating alerts until they're acknowledged or closed. 4 | 5 | :warning: _If the feature isn't available on your site, keep checking Jira Service Management for updates._ 6 | 7 | **Requirements** 8 | 9 | This project uses Maven 3 and requires Java 7 or higher. The plugin requires Graylog 1.0.0 or higher. 10 | 11 | **Steps to build the plugin** 12 | 13 | 1. Clone this repository. 14 | 2. Run mvn package to build a JAR file. 15 | 3. Optional: Run mvn jdeb:jdeb and mvn rpm:rpm to create a DEB and RPM package respectively. 16 | 4. Copy the generated JAR file into a target directory within the Graylog plugin directory. 17 | 5. Restart Graylog. -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/urllib3/util/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | # For backwards compatibility, provide imports that used to be here. 3 | from .connection import is_connection_dropped 4 | from .request import make_headers 5 | from .response import is_fp_closed 6 | from .ssl_ import ( 7 | SSLContext, 8 | HAS_SNI, 9 | IS_PYOPENSSL, 10 | assert_fingerprint, 11 | resolve_cert_reqs, 12 | resolve_ssl_version, 13 | ssl_wrap_socket, 14 | ) 15 | from .timeout import ( 16 | current_time, 17 | Timeout, 18 | ) 19 | 20 | from .retry import Retry 21 | from .url import ( 22 | get_host, 23 | parse_url, 24 | split_first, 25 | Url, 26 | ) 27 | 28 | __all__ = ( 29 | 'HAS_SNI', 30 | 'IS_PYOPENSSL', 31 | 'SSLContext', 32 | 'Retry', 33 | 'Timeout', 34 | 'Url', 35 | 'assert_fingerprint', 36 | 'current_time', 37 | 'is_connection_dropped', 38 | 'is_fp_closed', 39 | 'get_host', 40 | 'parse_url', 41 | 'make_headers', 42 | 'resolve_cert_reqs', 43 | 'resolve_ssl_version', 44 | 'split_first', 45 | 'ssl_wrap_socket', 46 | ) 47 | -------------------------------------------------------------------------------- /solarwinds-web-help-desk/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [], 6 | "globalFlags": { 7 | "serverUrl": "", 8 | "apiToken": "" 9 | }, 10 | "actionMappings": { 11 | "Acknowledge": { 12 | "filepath": "", 13 | "sourceType": "", 14 | "env": [], 15 | "stdout": "" 16 | }, 17 | "AddNote": { 18 | "filepath": "", 19 | "sourceType": "", 20 | "env": [], 21 | "stdout": "" 22 | }, 23 | "Close": { 24 | "filepath": "", 25 | "sourceType": "", 26 | "env": [], 27 | "stdout": "" 28 | } 29 | }, 30 | "pollerConf": { 31 | "pollingWaitIntervalInMillis": 100, 32 | "visibilityTimeoutInSec": 30, 33 | "maxNumberOfMessages": 10 34 | }, 35 | "poolConf": { 36 | "maxNumberOfWorker": 12, 37 | "minNumberOfWorker": 4, 38 | "monitoringPeriodInMillis": 15000, 39 | "keepAliveTimeInMillis": 6000, 40 | "queueSize": 0 41 | } 42 | } -------------------------------------------------------------------------------- /connectwise-automate/conf/AlertScript.ps1: -------------------------------------------------------------------------------- 1 | # Script Parameters for CW: "@eu" "@apiKey@" "@Status@" "%clientname%" "%computername%" "%locationname%" "@Fieldname@" "@Result@" "%when%" "%ContactName%" "@Monitor@" 2 | 3 | param ( 4 | [string]$eu = "False", 5 | [string]$apiKey = "apiKey", 6 | [string]$status = "status", 7 | [string]$clientname = "client", 8 | [string]$computername = "computer", 9 | [string]$locationname = "location", 10 | [string]$fieldname = "field", 11 | [string]$result = "result", 12 | [string]$when = "when", 13 | [string]$contactName = "contact", 14 | [string]$monitorName = "monitor" 15 | ) 16 | 17 | $uri = "https://api.atlassian.com/jsm/ops/integration/v1/json/integrations/webhooks/connectwiseautomate?apiKey=" + $apiKey; 18 | 19 | $body = ConvertTo-Json @{ 20 | status = $status 21 | clientName = $clientname 22 | computerName = $computername 23 | locationName = $locationname 24 | fieldName = $fieldname 25 | result = $result 26 | when = $when 27 | contactName = $contactName 28 | monitorName = $monitorName 29 | } 30 | $headers = [Hashtable] @{ 31 | Type = 'application/json' 32 | }; 33 | $result = Invoke-RestMethod -Method "Post" -Uri $uri -Headers $headers -Body $body -ContentType 'application/json' 34 | Write-Output $result 35 | -------------------------------------------------------------------------------- /manage-engine/conf/payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "id":"${id}", 3 | "requester":"${requester}", 4 | "category":"${category}", 5 | "subcategory":"${subcategory}", 6 | "technician":"${technician}", 7 | "subject":"${subject}", 8 | "priority":"${priority}", 9 | "mode":"${mode}", 10 | "urgency":"${urgency}", 11 | "status":"${status}", 12 | "is_escalated":"${is_escalated}", 13 | "notification_status":"${notification_status}", 14 | "resolved_time":"${resolved_time}", 15 | "requester_ack_comments":"${requester_ack_comments}", 16 | "request_type":"${request_type}", 17 | "responded_time":"${responded_time}", 18 | "requester_ack_resolution":"${requester_ack_resolution}", 19 | "created_time":"${created_time}", 20 | "created_by":"${created_by}", 21 | "completed_time":"${completed_time}", 22 | "template":"${template}", 23 | "approval_status":"${approval_status}", 24 | "scheduled_time":"${scheduled_time}", 25 | "service_category":"${service_category}", 26 | "site":"${site}", 27 | "deleted_time":"${deleted_time}", 28 | "display_id":"${display_id}", 29 | "due_by_time":"${due_by_time}", 30 | "first_response_due_by_time":"${first_response_due_by_time}", 31 | "group":"${group}", 32 | "has_notes":"${has_notes}", 33 | "department":"${department}", 34 | "description":"${description}" 35 | } -------------------------------------------------------------------------------- /bmc-remedy/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [], 6 | "globalFlags": { 7 | "username": "", 8 | "password": "", 9 | "midtierServerUrl": "", 10 | "serverName": "" 11 | }, 12 | "actionMappings": { 13 | "createIncident": { 14 | "filepath": "", 15 | "sourceType": "", 16 | "env": [], 17 | "stdout": "" 18 | }, 19 | "addWorkInfo": { 20 | "filepath": "", 21 | "sourceType": "", 22 | "env": [], 23 | "stdout": "" 24 | }, 25 | "closeIncident": { 26 | "filepath": "", 27 | "sourceType": "", 28 | "env": [], 29 | "stdout": "" 30 | } 31 | }, 32 | "pollerConf": { 33 | "pollingWaitIntervalInMillis": 100, 34 | "visibilityTimeoutInSec": 30, 35 | "maxNumberOfMessages": 10 36 | }, 37 | "poolConf": { 38 | "maxNumberOfWorker": 12, 39 | "minNumberOfWorker": 4, 40 | "monitoringPeriodInMillis": 15000, 41 | "keepAliveTimeInMillis": 6000, 42 | "queueSize": 0 43 | } 44 | } -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Jira Service Management Integration Scripts 2 | 3 | Thank you for considering a contribution to Jira Service Management Integration Scripts! Pull requests, issues and comments are welcome. For pull requests, please: 4 | 5 | * Add tests for new features and bug fixes 6 | * Follow the existing style 7 | * Separate unrelated changes into multiple pull requests 8 | 9 | See the existing issues for things to start contributing. 10 | 11 | For bigger changes, please make sure you start a discussion first by creating an issue and explaining the intended change. 12 | 13 | Atlassian requires contributors to sign a Contributor License Agreement, known as a CLA. This serves as a record stating that the contributor is entitled to contribute the code/documentation/translation to the project and is willing to have it used in distributions and derivative works (or is willing to transfer ownership). 14 | 15 | Prior to accepting your contributions we ask that you please follow the appropriate link below to digitally sign the CLA. The Corporate CLA is for those who are contributing as a member of an organization and the individual CLA is for those contributing as an individual. 16 | 17 | * [CLA for corporate contributors](https://opensource.atlassian.com/corporate) 18 | * [CLA for individuals](https://opensource.atlassian.com/individual) -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/chardet/compat.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # Contributor(s): 3 | # Ian Cordasco - port to Python 4 | # 5 | # This library is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU Lesser General Public 7 | # License as published by the Free Software Foundation; either 8 | # version 2.1 of the License, or (at your option) any later version. 9 | # 10 | # This library is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public 16 | # License along with this library; if not, write to the Free Software 17 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 18 | # 02110-1301 USA 19 | ######################### END LICENSE BLOCK ######################### 20 | 21 | import sys 22 | 23 | 24 | if sys.version_info < (3, 0): 25 | base_str = (str, unicode) 26 | else: 27 | base_str = (bytes, str) 28 | 29 | 30 | def wrap_ord(a): 31 | if sys.version_info < (3, 0) and isinstance(a, base_str): 32 | return ord(a) 33 | else: 34 | return a 35 | -------------------------------------------------------------------------------- /jira-service-management/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [], 6 | "globalFlags": { 7 | "url": "", 8 | "username": "", 9 | "password": "", 10 | "issueTypeName": "", 11 | "key": "" 12 | }, 13 | "actionMappings": { 14 | "createIssue": { 15 | "filepath": "", 16 | "sourceType": "", 17 | "env": [], 18 | "stdout": "" 19 | }, 20 | "resolveIssue": { 21 | "filepath": "", 22 | "sourceType": "", 23 | "env": [], 24 | "stdout": "" 25 | }, 26 | "addComment": { 27 | "filepath": "", 28 | "sourceType": "", 29 | "env": [], 30 | "stdout": "" 31 | } 32 | }, 33 | "pollerConf": { 34 | "pollingWaitIntervalInMillis": 100, 35 | "visibilityTimeoutInSec": 30, 36 | "maxNumberOfMessages": 10 37 | }, 38 | "poolConf": { 39 | "maxNumberOfWorker": 12, 40 | "minNumberOfWorker": 4, 41 | "monitoringPeriodInMillis": 15000, 42 | "keepAliveTimeInMillis": 6000, 43 | "queueSize": 0 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /solarwinds-npm/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [], 6 | "globalFlags": { 7 | "url": "https://:17774", 8 | "login": "", 9 | "password": "" 10 | }, 11 | "actionMappings": { 12 | "Acknowledge": { 13 | "filepath": "", 14 | "sourceType": "", 15 | "env": [], 16 | "stdout": "" 17 | }, 18 | "AddNote": { 19 | "filepath": "", 20 | "sourceType": "", 21 | "env": [], 22 | "stdout": "" 23 | }, 24 | "Close": { 25 | "filepath": "", 26 | "sourceType": "", 27 | "env": [], 28 | "stdout": "" 29 | } 30 | }, 31 | "pollerConf": { 32 | "pollingWaitIntervalInMillis": 100, 33 | "visibilityTimeoutInSec": 30, 34 | "maxNumberOfMessages": 10 35 | }, 36 | "poolConf": { 37 | "maxNumberOfWorker": 12, 38 | "minNumberOfWorker": 4, 39 | "monitoringPeriodInMillis": 15000, 40 | "keepAliveTimeInMillis": 6000, 41 | "queueSize": 0 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /logstash-plugin/logstash-output-jsm.gemspec: -------------------------------------------------------------------------------- 1 | Gem::Specification.new do |s| 2 | s.name = 'logstash-output-jsm' 3 | s.version = '0.1.0' 4 | s.licenses = ["Apache License (2.0)"] 5 | s.summary = "This output Creates, Closes, Acknowledges alerts and Adds Note to alerts in Jira Service Management." 6 | s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program" 7 | s.authors = ["Elastic"] 8 | s.email = "info@elastic.co" 9 | s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html" 10 | s.require_paths = ["lib"] 11 | 12 | # Files 13 | s.files = Dir['lib/**/*', 'spec/**/*', 'vendor/**/*', '*.gemspec', '*.md', 'CONTRIBUTORS', 'Gemfile', 'LICENSE', 'NOTICE.TXT'] 14 | # Tests 15 | s.test_files = s.files.grep(%r{^(test|spec|features)/}) 16 | 17 | # Special flag to let us know this is actually a logstash plugin 18 | s.metadata = { "logstash_plugin" => "true", "logstash_group" => "output", "source_code_uri" => "https://github.com/atlassian/jsm-integration-scripts/tree/master/logstash-plugin"} 19 | 20 | # Gem dependencies 21 | s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99" 22 | s.add_runtime_dependency "logstash-codec-plain" 23 | s.add_development_dependency "logstash-devutils" 24 | end 25 | -------------------------------------------------------------------------------- /graylog-plugin/src/main/java/com/atlassian/plugin/graylog/JsmAlarmCallbackMetaData.java: -------------------------------------------------------------------------------- 1 | package com.atlassian.plugin.graylog; 2 | 3 | import org.graylog2.plugin.PluginMetaData; 4 | import org.graylog2.plugin.ServerStatus; 5 | import org.graylog2.plugin.Version; 6 | 7 | import java.net.URI; 8 | import java.util.Collections; 9 | import java.util.Set; 10 | 11 | public class JsmAlarmCallbackMetaData implements PluginMetaData { 12 | @Override 13 | public String getUniqueId() { 14 | return JsmAlarmCallback.class.getCanonicalName(); 15 | } 16 | 17 | @Override 18 | public String getName() { 19 | return "Jira Service Management Alarm Callback"; 20 | } 21 | 22 | @Override 23 | public String getAuthor() { 24 | return "Atlassian"; 25 | } 26 | 27 | @Override 28 | public URI getURL() { 29 | return URI.create("https://www.atlassian.com/"); 30 | } 31 | 32 | @Override 33 | public Version getVersion() { 34 | return new Version(1, 3, 15, "RELEASE"); 35 | } 36 | 37 | @Override 38 | public String getDescription() { 39 | return "Graylog Jira Service Management Integration plugin"; 40 | } 41 | 42 | @Override 43 | public Version getRequiredVersion() { 44 | return new Version(2, 3, 2); 45 | } 46 | 47 | @Override 48 | public Set getRequiredCapabilities() { 49 | return Collections.emptySet(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/chardet/__init__.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # This library is free software; you can redistribute it and/or 3 | # modify it under the terms of the GNU Lesser General Public 4 | # License as published by the Free Software Foundation; either 5 | # version 2.1 of the License, or (at your option) any later version. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 15 | # 02110-1301 USA 16 | ######################### END LICENSE BLOCK ######################### 17 | 18 | __version__ = "2.3.0" 19 | from sys import version_info 20 | 21 | 22 | def detect(aBuf): 23 | if ((version_info < (3, 0) and isinstance(aBuf, unicode)) or 24 | (version_info >= (3, 0) and not isinstance(aBuf, bytes))): 25 | raise ValueError('Expected a bytes object, not a unicode object') 26 | 27 | from . import universaldetector 28 | u = universaldetector.UniversalDetector() 29 | u.reset() 30 | u.feed(aBuf) 31 | u.close() 32 | return u.result 33 | -------------------------------------------------------------------------------- /cherwell/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [], 6 | "globalFlags": { 7 | "username": "", 8 | "password": "", 9 | "clientId": "", 10 | "apiUrl": "" 11 | }, 12 | "actionMappings": { 13 | "addJournal": { 14 | "filepath": "", 15 | "sourceType": "", 16 | "env": [], 17 | "stdout": "" 18 | }, 19 | "createIncident": { 20 | "filepath": "", 21 | "sourceType": "", 22 | "env": [], 23 | "stdout": "" 24 | }, 25 | "inProgressIncident": { 26 | "filepath": "", 27 | "sourceType": "", 28 | "env": [], 29 | "stdout": "" 30 | }, 31 | "resolveIncident": { 32 | "filepath": "", 33 | "sourceType": "", 34 | "env": [], 35 | "stdout": "" 36 | } 37 | }, 38 | "pollerConf": { 39 | "pollingWaitIntervalInMillis": 100, 40 | "visibilityTimeoutInSec": 30, 41 | "maxNumberOfMessages": 10 42 | }, 43 | "poolConf": { 44 | "maxNumberOfWorker": 12, 45 | "minNumberOfWorker": 4, 46 | "monitoringPeriodInMillis": 15000, 47 | "keepAliveTimeInMillis": 6000, 48 | "queueSize": 0 49 | } 50 | } -------------------------------------------------------------------------------- /bmc-footprints-v12/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [], 6 | "globalFlags": { 7 | "url": "", 8 | "username": "", 9 | "password": "", 10 | "workspaceName": "" 11 | }, 12 | "actionMappings": { 13 | "createIncident": { 14 | "filepath": "", 15 | "sourceType": "", 16 | "env": [], 17 | "stdout": "" 18 | }, 19 | "createProblem": { 20 | "filepath": "", 21 | "sourceType": "", 22 | "env": [], 23 | "stdout": "" 24 | }, 25 | "updateDescription": { 26 | "filepath": "", 27 | "sourceType": "", 28 | "env": [], 29 | "stdout": "" 30 | }, 31 | "updatePriority": { 32 | "filepath": "", 33 | "sourceType": "", 34 | "env": [], 35 | "stdout": "" 36 | } 37 | }, 38 | "pollerConf": { 39 | "pollingWaitIntervalInMillis": 100, 40 | "visibilityTimeoutInSec": 30, 41 | "maxNumberOfMessages": 10 42 | }, 43 | "poolConf": { 44 | "maxNumberOfWorker": 12, 45 | "minNumberOfWorker": 4, 46 | "monitoringPeriodInMillis": 15000, 47 | "keepAliveTimeInMillis": 6000, 48 | "queueSize": 0 49 | } 50 | } -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/chardet/constants.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # 13 | # This library is free software; you can redistribute it and/or 14 | # modify it under the terms of the GNU Lesser General Public 15 | # License as published by the Free Software Foundation; either 16 | # version 2.1 of the License, or (at your option) any later version. 17 | # 18 | # This library is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | # Lesser General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU Lesser General Public 24 | # License along with this library; if not, write to the Free Software 25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 26 | # 02110-1301 USA 27 | ######################### END LICENSE BLOCK ######################### 28 | 29 | _debug = 0 30 | 31 | eDetecting = 0 32 | eFoundIt = 1 33 | eNotMe = 2 34 | 35 | eStart = 0 36 | eError = 1 37 | eItsMe = 2 38 | 39 | SHORTCUT_THRESHOLD = 0.95 40 | -------------------------------------------------------------------------------- /release/jec-builder/jec-rpm/SPECS/jec.spec: -------------------------------------------------------------------------------- 1 | Name: %INTEGRATION% 2 | Version: %VERSION% 3 | Summary: JEC (%INTEGRATION%) for Connecting On-Premise Monitoring and ITSM Tools 4 | Release: 1 5 | License: Apache-2.0 6 | URL: https://www.atlassian.com/ 7 | Group: System 8 | Packager: Atlassian 9 | BuildRoot: . 10 | 11 | %description 12 | Jira Edge Connector (JEC) is designed to resolve challenges faced in the integration of internal and external systems. 13 | 14 | %prep 15 | echo "BUILDROOT = $RPM_BUILD_ROOT" 16 | mkdir -p $RPM_BUILD_ROOT/usr/local/bin/ 17 | mkdir -p $RPM_BUILD_ROOT/etc/systemd/system/ 18 | mkdir -p $RPM_BUILD_ROOT/home/jsm/jec/ 19 | cp $GITHUB_WORKSPACE/.release/jec-rpm/JiraEdgeConnector $RPM_BUILD_ROOT/usr/local/bin/ 20 | cp $GITHUB_WORKSPACE/.release/jec-rpm/jec.service $RPM_BUILD_ROOT/etc/systemd/system/ 21 | cp -R $GITHUB_WORKSPACE/.release/jec-rpm/jec-scripts/. $RPM_BUILD_ROOT/home/jsm/jec/ 22 | 23 | %pre 24 | if [ ! -d "/var/log/jec" ]; then 25 | mkdir /var/log/jec 26 | fi 27 | 28 | if [ ! -d "/home/jsm" ]; then 29 | mkdir /home/jsm 30 | fi 31 | 32 | if [ -z $(getent passwd jec) ]; then 33 | groupadd jec -r 34 | useradd -g jec jec -r -d /home/jsm 35 | fi 36 | 37 | %post 38 | chown -R jec:jec /home/jsm 39 | chown -R jec:jec /var/log/jec 40 | 41 | chmod +x /etc/systemd/system/jec.service 42 | chmod +x /usr/local/bin/JiraEdgeConnector 43 | systemctl daemon-reload 44 | systemctl enable jec 45 | 46 | %postun 47 | systemctl daemon-reload 48 | 49 | %files 50 | /usr/local/bin/JiraEdgeConnector 51 | /etc/systemd/system/jec.service 52 | /home/jsm/jec/ -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/__init__.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Debian and other distributions "unbundle" requests' vendored dependencies, and 3 | rewrite all imports to use the global versions of ``urllib3`` and ``chardet``. 4 | The problem with this is that not only requests itself imports those 5 | dependencies, but third-party code outside of the distros' control too. 6 | 7 | In reaction to these problems, the distro maintainers replaced 8 | ``requests.packages`` with a magical "stub module" that imports the correct 9 | modules. The implementations were varying in quality and all had severe 10 | problems. For example, a symlink (or hardlink) that links the correct modules 11 | into place introduces problems regarding object identity, since you now have 12 | two modules in `sys.modules` with the same API, but different identities:: 13 | 14 | requests.packages.urllib3 is not urllib3 15 | 16 | With version ``2.5.2``, requests started to maintain its own stub, so that 17 | distro-specific breakage would be reduced to a minimum, even though the whole 18 | issue is not requests' fault in the first place. See 19 | https://github.com/kennethreitz/requests/pull/2375 for the corresponding pull 20 | request. 21 | ''' 22 | 23 | from __future__ import absolute_import 24 | import sys 25 | 26 | try: 27 | from . import urllib3 28 | except ImportError: 29 | import urllib3 30 | sys.modules['%s.urllib3' % __name__] = urllib3 31 | 32 | try: 33 | from . import chardet 34 | except ImportError: 35 | import chardet 36 | sys.modules['%s.chardet' % __name__] = chardet 37 | -------------------------------------------------------------------------------- /release/jec-builder/jec-rpm/SPECS/jec-rhel6.spec: -------------------------------------------------------------------------------- 1 | Name: %INTEGRATION%-rhel6 2 | Version: %VERSION% 3 | Summary: JEC (%INTEGRATION%) for Connecting On-Premise Monitoring and ITSM Tools 4 | Release: 1 5 | License: Apache-2.0 6 | URL: https://www.atlassian.com/ 7 | Group: System 8 | Packager: Atlassian 9 | BuildRoot: ~/rpmbuild/ 10 | 11 | %description 12 | Jira Edge Connector (JEC) is designed to resolve challenges faced in the integration of internal and external systems. 13 | 14 | %prep 15 | echo "BUILDROOT = $RPM_BUILD_ROOT" 16 | mkdir -p $RPM_BUILD_ROOT/usr/local/bin/ 17 | mkdir -p $RPM_BUILD_ROOT/home/jsm/jec/ 18 | cp $GITHUB_WORKSPACE/.release/jec-rpm/JiraEdgeConnector $RPM_BUILD_ROOT/usr/local/bin/ 19 | cp -R $GITHUB_WORKSPACE/.release/jec-rpm/jec-scripts/. $RPM_BUILD_ROOT/home/jsm/jec/ 20 | 21 | mkdir -p $RPM_BUILD_ROOT/etc/init.d/ 22 | cp $GITHUB_WORKSPACE/.release/jec-rpm/rhel6-service/jec $RPM_BUILD_ROOT/etc/init.d/ 23 | 24 | %pre 25 | if [ ! -d "/var/log/jec" ]; then 26 | mkdir /var/log/jec 27 | fi 28 | 29 | if [ ! -d "/home/jsm" ]; then 30 | mkdir /home/jsm 31 | fi 32 | 33 | if [ -z $(getent passwd jec) ]; then 34 | groupadd jec -r 35 | useradd -g jec jec -r -d /home/jsm 36 | fi 37 | 38 | %post 39 | chown -R jec:jec /home/jsm 40 | chown -R jec:jec /var/log/jec 41 | 42 | chmod +x /usr/local/bin/JiraEdgeConnector 43 | 44 | chmod +x /etc/init.d/jec 45 | service jec start 46 | 47 | %postun 48 | service jec stop 49 | rm /etc/init.d/jec 50 | 51 | %files 52 | /usr/local/bin/JiraEdgeConnector 53 | /etc/init.d/jec 54 | /home/jsm/jec/ 55 | 56 | %changelog 57 | -------------------------------------------------------------------------------- /bmc-footprints-v11/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [], 6 | "globalFlags": { 7 | "url": "", 8 | "username": "", 9 | "password": "", 10 | "incidentWorkspaceId": "", 11 | "problemWorkspaceId": "" 12 | }, 13 | "actionMappings": { 14 | "createIncident": { 15 | "filepath": "", 16 | "sourceType": "", 17 | "env": [], 18 | "stdout": "" 19 | }, 20 | "createProblem": { 21 | "filepath": "", 22 | "sourceType": "", 23 | "env": [], 24 | "stdout": "" 25 | }, 26 | "updateDescription": { 27 | "filepath": "", 28 | "sourceType": "", 29 | "env": [], 30 | "stdout": "" 31 | }, 32 | "updatePriority": { 33 | "filepath": "", 34 | "sourceType": "", 35 | "env": [], 36 | "stdout": "" 37 | } 38 | }, 39 | "pollerConf": { 40 | "pollingWaitIntervalInMillis": 100, 41 | "visibilityTimeoutInSec": 30, 42 | "maxNumberOfMessages": 10 43 | }, 44 | "poolConf": { 45 | "maxNumberOfWorker": 12, 46 | "minNumberOfWorker": 4, 47 | "monitoringPeriodInMillis": 15000, 48 | "keepAliveTimeInMillis": 6000, 49 | "queueSize": 0 50 | } 51 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Jira Service Management Integration Scripts 3 | 4 | [![Atlassian license](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat-square)](LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](CONTRIBUTING.md) 5 | 6 | > The project includes Jira Service Management's specific integration packages: 7 | > * amazon-clod-trail 8 | > * amazon-security-hub 9 | > * freshservice 10 | > * icinga 11 | > * icinga2 12 | > * jec 13 | > * kayako 14 | > * logic-monitor 15 | > * magentrix 16 | > * manage-engine 17 | > * nagios 18 | > * nagios-xi 19 | > * op5 20 | > * prtg 21 | > * scom 22 | > * solarwinds-msp-n-central 23 | > * solarwinds-npm 24 | > * solarwinfs-web-help-desk 25 | > * zenoss 26 | > * zabbix 27 | > * bmc-footprints-v11 28 | > * bmc-footprints-v12 29 | > * bmc-remedy 30 | > * cherwell 31 | > * jira-service-management 32 | > * jira-software 33 | > * trackit 34 | > * librenms 35 | > * graylog-plugin 36 | > * logstash-output-plugin 37 | 38 | ## Installation and Documentation 39 | 40 | > Documentation links will be added for each integration with the installation steps. 41 | 42 | ## Contributions 43 | 44 | Contributions to jsm-integration-scripts are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details. 45 | 46 | ## License 47 | 48 | Copyright (c) [2023] Atlassian US., Inc. 49 | Apache 2.0 licensed, see [LICENSE](LICENSE) file. 50 | 51 |
52 | 53 | [![With ❤️ from Atlassian](https://raw.githubusercontent.com/atlassian-internal/oss-assets/master/banner-with-thanks-light.png)](https://www.atlassian.com) 54 | 55 | -------------------------------------------------------------------------------- /trackit/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [], 6 | "globalFlags": { 7 | "url": "https://", 8 | "login": "", 9 | "password": "" 10 | }, 11 | "actionMappings": { 12 | "Create": { 13 | "filepath": "", 14 | "sourceType": "", 15 | "env": [], 16 | "stdout": "" 17 | }, 18 | "AddNote": { 19 | "filepath": "", 20 | "sourceType": "", 21 | "env": [], 22 | "stdout": "" 23 | }, 24 | "AddResponder": { 25 | "filepath": "", 26 | "sourceType": "", 27 | "env": [], 28 | "stdout": "" 29 | }, 30 | "AssignOwnership": { 31 | "filepath": "", 32 | "sourceType": "", 33 | "env": [], 34 | "stdout": "" 35 | }, 36 | "TakeOwnership": { 37 | "filepath": "", 38 | "sourceType": "", 39 | "env": [], 40 | "stdout": "" 41 | }, 42 | "Close": { 43 | "filepath": "", 44 | "sourceType": "", 45 | "env": [], 46 | "stdout": "" 47 | } 48 | }, 49 | "pollerConf": { 50 | "pollingWaitIntervalInMillis": 100, 51 | "visibilityTimeoutInSec": 30, 52 | "maxNumberOfMessages": 10 53 | }, 54 | "poolConf": { 55 | "maxNumberOfWorker": 12, 56 | "minNumberOfWorker": 4, 57 | "monitoringPeriodInMillis": 15000, 58 | "keepAliveTimeInMillis": 6000, 59 | "queueSize": 0 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /jec/scripts/http.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import json 3 | 4 | import requests 5 | 6 | parser = argparse.ArgumentParser() 7 | parser.add_argument('-payload', '--queuePayload', required=True) 8 | parser.add_argument('-logLevel', '--logLevel', required=True) 9 | parser.add_argument('-apiKey', '--apiKey', required=True) 10 | parser.add_argument('-jsmUrl', '--jsmUrl', required=True) 11 | parser.add_argument('-method', '--method', required=False) 12 | parser.add_argument('-url', '--url', required=False) 13 | parser.add_argument('-headers', '--headers', type=json.loads, required=False) 14 | parser.add_argument('-params', '--params', type=json.loads, required=False) 15 | parser.add_argument('-body', '--body', required=False) 16 | args, unknown = parser.parse_known_args() 17 | args = vars(args) 18 | 19 | raw_message = args['queuePayload'] 20 | raw_message = raw_message.strip() 21 | message = json.loads(raw_message) 22 | 23 | 24 | def parse_field(key, mandatory=True): 25 | variable = args.get(key) 26 | if not variable: 27 | variable = message.get(key) 28 | if not variable and mandatory: 29 | raise ValueError("Skipping execution [" + key + "] field does not exist in payload and configs.") 30 | return variable 31 | 32 | 33 | def main(): 34 | method = parse_field("method") 35 | url = parse_field("url") 36 | headers = parse_field("headers", False) 37 | params = parse_field("params", False) 38 | body = parse_field("body", False) 39 | 40 | response = requests.request(method=method, url=url, headers=headers, 41 | params=params, data=body) 42 | 43 | result = { 44 | "headers": dict(response.headers), 45 | "body": response.text, 46 | "statusCode": response.status_code 47 | } 48 | 49 | print(json.dumps(result)) 50 | 51 | 52 | if __name__ == '__main__': 53 | main() 54 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/compat.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests.compat 5 | ~~~~~~~~~~~~~~~ 6 | 7 | This module handles import compatibility issues between Python 2 and 8 | Python 3. 9 | """ 10 | 11 | from .packages import chardet 12 | 13 | import sys 14 | 15 | # ------- 16 | # Pythons 17 | # ------- 18 | 19 | # Syntax sugar. 20 | _ver = sys.version_info 21 | 22 | #: Python 2.x? 23 | is_py2 = (_ver[0] == 2) 24 | 25 | #: Python 3.x? 26 | is_py3 = (_ver[0] == 3) 27 | 28 | try: 29 | import simplejson as json 30 | except (ImportError, SyntaxError): 31 | # simplejson does not support Python 3.2, it throws a SyntaxError 32 | # because of u'...' Unicode literals. 33 | import json 34 | 35 | # --------- 36 | # Specifics 37 | # --------- 38 | 39 | if is_py2: 40 | from urllib import quote, unquote, quote_plus, unquote_plus, urlencode, getproxies, proxy_bypass 41 | from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag 42 | from urllib2 import parse_http_list 43 | import cookielib 44 | from Cookie import Morsel 45 | from StringIO import StringIO 46 | from .packages.urllib3.packages.ordered_dict import OrderedDict 47 | 48 | builtin_str = str 49 | bytes = str 50 | str = unicode 51 | basestring = basestring 52 | numeric_types = (int, long, float) 53 | 54 | elif is_py3: 55 | from urllib.parse import urlparse, urlunparse, urljoin, urlsplit, urlencode, quote, unquote, quote_plus, unquote_plus, urldefrag 56 | from urllib.request import parse_http_list, getproxies, proxy_bypass 57 | from http import cookiejar as cookielib 58 | from http.cookies import Morsel 59 | from io import StringIO 60 | from collections import OrderedDict 61 | 62 | builtin_str = str 63 | str = str 64 | bytes = bytes 65 | basestring = (str, bytes) 66 | numeric_types = (int, float) 67 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/chardet/euctwprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCTWDistributionAnalysis 31 | from .mbcssm import EUCTWSMModel 32 | 33 | class EUCTWProber(MultiByteCharSetProber): 34 | def __init__(self): 35 | MultiByteCharSetProber.__init__(self) 36 | self._mCodingSM = CodingStateMachine(EUCTWSMModel) 37 | self._mDistributionAnalyzer = EUCTWDistributionAnalysis() 38 | self.reset() 39 | 40 | def get_charset_name(self): 41 | return "EUC-TW" 42 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/chardet/euckrprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCKRDistributionAnalysis 31 | from .mbcssm import EUCKRSMModel 32 | 33 | 34 | class EUCKRProber(MultiByteCharSetProber): 35 | def __init__(self): 36 | MultiByteCharSetProber.__init__(self) 37 | self._mCodingSM = CodingStateMachine(EUCKRSMModel) 38 | self._mDistributionAnalyzer = EUCKRDistributionAnalysis() 39 | self.reset() 40 | 41 | def get_charset_name(self): 42 | return "EUC-KR" 43 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/chardet/gb2312prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import GB2312DistributionAnalysis 31 | from .mbcssm import GB2312SMModel 32 | 33 | class GB2312Prober(MultiByteCharSetProber): 34 | def __init__(self): 35 | MultiByteCharSetProber.__init__(self) 36 | self._mCodingSM = CodingStateMachine(GB2312SMModel) 37 | self._mDistributionAnalyzer = GB2312DistributionAnalysis() 38 | self.reset() 39 | 40 | def get_charset_name(self): 41 | return "GB2312" 42 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/chardet/big5prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Communicator client code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import Big5DistributionAnalysis 31 | from .mbcssm import Big5SMModel 32 | 33 | 34 | class Big5Prober(MultiByteCharSetProber): 35 | def __init__(self): 36 | MultiByteCharSetProber.__init__(self) 37 | self._mCodingSM = CodingStateMachine(Big5SMModel) 38 | self._mDistributionAnalyzer = Big5DistributionAnalysis() 39 | self.reset() 40 | 41 | def get_charset_name(self): 42 | return "Big5" 43 | -------------------------------------------------------------------------------- /amazon-security-hub/conf/security-hub-template.json: -------------------------------------------------------------------------------- 1 | { 2 | "AWSTemplateFormatVersion" : "2010-09-09", 3 | "Description" : "Template that creates a CloudWatch Event for Jira Service Management SecurityHub Integration", 4 | 5 | "Parameters" : { 6 | "EventPatternParameter" : { 7 | "Type": "String", 8 | "Description" : "Provide a JSON Object that represents the Event Pattern" 9 | }, 10 | "SNSSubEndpoint" : { 11 | "Type" : "String", 12 | "Description" : "Enter the SNS Subscription Endpoint" 13 | } 14 | }, 15 | 16 | "Resources" : { 17 | "securityHubCWERule": { 18 | "DependsOn": "JSMSHSNSTopic", 19 | "Type": "AWS::Events::Rule", 20 | "Properties": { 21 | "Description": "SecurityHub Event Rule", 22 | "EventPattern": {"Ref": "EventPatternParameter"}, 23 | "State": "ENABLED", 24 | "Targets": [ 25 | { 26 | "Arn": { "Ref": "JSMSHSNSTopic" }, 27 | "Id": "SecurityHubTopic" 28 | } 29 | ] 30 | } 31 | }, 32 | 33 | "JSMSHSNSTopic": { 34 | "Type": "AWS::SNS::Topic", 35 | "Properties": { 36 | "Subscription": [ 37 | {"Endpoint": {"Ref": "SNSSubEndpoint"}, "Protocol" : "https"} 38 | ], 39 | "TopicName": "JSMSHFindingTopic", 40 | "DisplayName": "JSMSHFindingTopic" 41 | } 42 | }, 43 | 44 | "EventTopicPolicy": { 45 | "DependsOn": "JSMSHSNSTopic", 46 | "Type": "AWS::SNS::TopicPolicy", 47 | "Properties": { 48 | "PolicyDocument": { 49 | "Statement": [ 50 | { 51 | "Effect": "Allow", 52 | "Principal": { "Service": "events.amazonaws.com" }, 53 | "Action": "sns:Publish", 54 | "Resource": "*" 55 | } 56 | ] 57 | }, 58 | "Topics": [ { "Ref": "JSMSHSNSTopic" } ] 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /icinga2/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [], 6 | "globalFlags": { 7 | "graphite_url": "http://localhost:5003", 8 | "api_url": "https://localhost:5665", 9 | "user": "icingaadmin", 10 | "password": "icingaadmin", 11 | "insecure": "false" 12 | }, 13 | "actionMappings": { 14 | "Create": { 15 | "filepath": "", 16 | "sourceType": "", 17 | "env": [], 18 | "stdout": "" 19 | }, 20 | "Acknowledge": { 21 | "filepath": "", 22 | "sourceType": "", 23 | "env": [], 24 | "stdout": "" 25 | }, 26 | "AddNote": { 27 | "filepath": "", 28 | "sourceType": "", 29 | "env": [], 30 | "stdout": "" 31 | }, 32 | "TakeOwnership": { 33 | "filepath": "", 34 | "sourceType": "", 35 | "env": [], 36 | "stdout": "" 37 | }, 38 | "AssignOwnership": { 39 | "filepath": "", 40 | "sourceType": "", 41 | "env": [], 42 | "stdout": "" 43 | }, 44 | "UnAcknowledge": { 45 | "filepath": "", 46 | "sourceType": "", 47 | "env": [], 48 | "stdout": "" 49 | } 50 | }, 51 | "pollerConf": { 52 | "pollingWaitIntervalInMillis": 100, 53 | "visibilityTimeoutInSec": 30, 54 | "maxNumberOfMessages": 10 55 | }, 56 | "poolConf": { 57 | "maxNumberOfWorker": 12, 58 | "minNumberOfWorker": 4, 59 | "monitoringPeriodInMillis": 15000, 60 | "keepAliveTimeInMillis": 6000, 61 | "queueSize": 0 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /jira-software/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [], 6 | "globalFlags": { 7 | "url": "", 8 | "username": "", 9 | "password": "", 10 | "issueTypeName": "", 11 | "projectKey": "" 12 | }, 13 | "actionMappings": { 14 | "createIssue": { 15 | "filepath": "", 16 | "sourceType": "", 17 | "env": [], 18 | "stdout": "" 19 | }, 20 | "resolveIssue": { 21 | "filepath": "", 22 | "sourceType": "", 23 | "env": [], 24 | "stdout": "" 25 | }, 26 | "inProgressIssue": { 27 | "filepath": "", 28 | "sourceType": "", 29 | "env": [], 30 | "stdout": "" 31 | }, 32 | "closeIssue": { 33 | "filepath": "", 34 | "sourceType": "", 35 | "env": [], 36 | "stdout": "" 37 | }, 38 | "issueDone": { 39 | "filepath": "", 40 | "sourceType": "", 41 | "env": [], 42 | "stdout": "" 43 | }, 44 | "addCommentToIssue": { 45 | "filepath": "", 46 | "sourceType": "", 47 | "env": [], 48 | "stdout": "" 49 | } 50 | }, 51 | "pollerConf": { 52 | "pollingWaitIntervalInMillis": 100, 53 | "visibilityTimeoutInSec": 30, 54 | "maxNumberOfMessages": 10 55 | }, 56 | "poolConf": { 57 | "maxNumberOfWorker": 12, 58 | "minNumberOfWorker": 4, 59 | "monitoringPeriodInMillis": 15000, 60 | "keepAliveTimeInMillis": 6000, 61 | "queueSize": 0 62 | } 63 | } -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/chardet/cp949prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCKRDistributionAnalysis 31 | from .mbcssm import CP949SMModel 32 | 33 | 34 | class CP949Prober(MultiByteCharSetProber): 35 | def __init__(self): 36 | MultiByteCharSetProber.__init__(self) 37 | self._mCodingSM = CodingStateMachine(CP949SMModel) 38 | # NOTE: CP949 is a superset of EUC-KR, so the distribution should be 39 | # not different. 40 | self._mDistributionAnalyzer = EUCKRDistributionAnalysis() 41 | self.reset() 42 | 43 | def get_charset_name(self): 44 | return "CP949" 45 | -------------------------------------------------------------------------------- /logstash-plugin/README.md: -------------------------------------------------------------------------------- 1 | # Jira Service Management Logstash Plugin 2 | 3 | 1. Download the [Logstash plugin](https://github.com/elastic/logstash).
4 | The plugin is entirely free and open-source. It's under the Apache 2.0 license, so you can use it in the way that 5 | best suits your needs. 6 | 7 | 2. Install and run the Jira Service Management output plugin in Logstash: 8 | * For Logstash 5.4+
9 | `bin/logstash-plugin install logstash-output-jsm` 10 | * For other versions
11 | `bin/plugin install logstash-output-jsm` 12 | 13 | 3. Add a Logstash integration in Jira Service Management and copy the API key.
14 | :warning: If the feature isn’t available on your site, keep checking Jira Service Management for updates. 15 | 16 | 4. Use plugins such as [Mutate](https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html) to populate the fields that [logstash-output-jsm](https://github.com/atlassian/jsm-integration-scripts/) will use. 17 | 18 | ``` ruby 19 | filter { 20 | mutate { 21 | add_field => { 22 | "jsmAction" => "create" 23 | "alias" => "neo123" 24 | "description" => "Every alert needs a description" 25 | "actions" => ["Restart", "AnExampleAction"] 26 | "tags" => ["OverwriteQuietHours","Critical"] 27 | "[details][prop1]" => "val1" 28 | "[details][prop2]" => "val2" 29 | "entity" => "An example entity" 30 | "priority" => "P4" 31 | "source" => "custom source" 32 | "user" => "custom user" 33 | "note" => "alert is created" 34 | } 35 | } 36 | ruby { 37 | code => "event.set('teams', [{'name' => 'Integration'}, {'name' => 'Platform'}])" 38 | } 39 | } 40 | ``` 41 | 42 | 5. Add the following to your configuration file and enter the integration API key you copied earlier into **apiKey**. 43 | ``` ruby 44 | output { 45 | jsm { 46 | "apiKey" => "logstash_integration_api_key" 47 | } 48 | } 49 | ``` 50 | 51 | 6. Run Logstash. 52 | -------------------------------------------------------------------------------- /nagios-xi/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [], 6 | "globalFlags": { 7 | "alert_histogram_image_url": "http://localhost/nagios/cgi-bin/histogram.cgi", 8 | "trends_image_url": "http://localhost/nagios/cgi-bin/trends.cgi", 9 | "command_url": "http://localhost/nagios/cgi-bin/cmd.cgi", 10 | "user": "nagiosadmin", 11 | "password": "admin" 12 | }, 13 | "actionMappings": { 14 | "Create": { 15 | "filepath": "", 16 | "sourceType": "", 17 | "env": [], 18 | "stdout": "" 19 | }, 20 | "Acknowledge": { 21 | "filepath": "", 22 | "sourceType": "", 23 | "env": [], 24 | "stdout": "" 25 | }, 26 | "AddNote": { 27 | "filepath": "", 28 | "sourceType": "", 29 | "env": [], 30 | "stdout": "" 31 | }, 32 | "TakeOwnership": { 33 | "filepath": "", 34 | "sourceType": "", 35 | "env": [], 36 | "stdout": "" 37 | }, 38 | "AssignOwnership": { 39 | "filepath": "", 40 | "sourceType": "", 41 | "env": [], 42 | "stdout": "" 43 | }, 44 | "UnAcknowledge": { 45 | "filepath": "", 46 | "sourceType": "", 47 | "env": [], 48 | "stdout": "" 49 | } 50 | }, 51 | "pollerConf": { 52 | "pollingWaitIntervalInMillis": 100, 53 | "visibilityTimeoutInSec": 30, 54 | "maxNumberOfMessages": 10 55 | }, 56 | "poolConf": { 57 | "maxNumberOfWorker": 12, 58 | "minNumberOfWorker": 4, 59 | "monitoringPeriodInMillis": 15000, 60 | "keepAliveTimeInMillis": 6000, 61 | "queueSize": 0 62 | } 63 | } -------------------------------------------------------------------------------- /icinga/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [], 6 | "globalFlags": { 7 | "alert_histogram_image_url": "http://localhost/icinga/cgi-bin/histogram.cgi", 8 | "trends_image_url": "http://localhost/icinga/cgi-bin/trends.cgi", 9 | "command_url": "http://localhost/icinga/cgi-bin/cmd.cgi", 10 | "user": "icingaadmin", 11 | "password": "icingaadmin" 12 | }, 13 | "actionMappings": { 14 | "Create": { 15 | "filepath": "", 16 | "sourceType": "", 17 | "env": [], 18 | "stdout": "" 19 | }, 20 | "Acknowledge": { 21 | "filepath": "", 22 | "sourceType": "", 23 | "env": [], 24 | "stdout": "" 25 | }, 26 | "AddNote": { 27 | "filepath": "", 28 | "sourceType": "", 29 | "env": [ 30 | "e1=v1", 31 | "e2=v2" 32 | ], 33 | "stdout": "" 34 | }, 35 | "TakeOwnership": { 36 | "filepath": "", 37 | "sourceType": "", 38 | "env": [], 39 | "stdout": "" 40 | }, 41 | "AssignOwnership": { 42 | "filepath": "", 43 | "sourceType": "", 44 | "env": [], 45 | "stdout": "" 46 | }, 47 | "UnAcknowledge": { 48 | "filepath": "", 49 | "sourceType": "", 50 | "env": [], 51 | "stdout": "" 52 | } 53 | }, 54 | "pollerConf": { 55 | "pollingWaitIntervalInMillis": 100, 56 | "visibilityTimeoutInSec": 30, 57 | "maxNumberOfMessages": 10 58 | }, 59 | "poolConf": { 60 | "maxNumberOfWorker": 12, 61 | "minNumberOfWorker": 4, 62 | "monitoringPeriodInMillis": 15000, 63 | "keepAliveTimeInMillis": 6000, 64 | "queueSize": 0 65 | } 66 | } -------------------------------------------------------------------------------- /.github/workflows/release-graylog-plugin.yml: -------------------------------------------------------------------------------- 1 | name: Release Graylog Plugin 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | release-version: 6 | description: 'Version of Release' 7 | required: true 8 | jobs: 9 | maven: 10 | name: Graylog Plugin Release 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout project sources 14 | uses: actions/checkout@v4 15 | - name: Set up JDK 8 16 | uses: actions/setup-java@v2 17 | with: 18 | java-version: 8 19 | distribution: 'temurin' 20 | - name: Create Build Output Directory 21 | run: mkdir -p ./mvn-build/graylog-plugin 22 | - name: Copy Integration Files 23 | run: cp -R graylog-plugin/. ./mvn-build/graylog-plugin 24 | - name: Build project with Maven 25 | run: | 26 | cd ./mvn-build/graylog-plugin && \ 27 | mvn -B package -Dversion=${{ github.event.inputs.release-version }} --file pom.xml 28 | - name: Compressing mvn Package 29 | run: | 30 | cd ./mvn-build/graylog-plugin/target 31 | zip -r jsm-graylog-plugin-${{ github.event.inputs.release-version }}.zip ./jsm-graylog-plugin-${{ github.event.inputs.release-version }}.jar 32 | - name: release 33 | uses: actions/create-release@v1 34 | id: create_release 35 | with: 36 | draft: false 37 | prerelease: false 38 | tag_name: jsm-graylog-plugin-${{ github.event.inputs.release-version }} 39 | release_name: jsm-graylog-plugin-${{ github.event.inputs.release-version }} 40 | env: 41 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 42 | - name: Upload release artifacts 43 | uses: actions/upload-release-asset@v1 44 | env: 45 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 46 | with: 47 | upload_url: ${{ steps.create_release.outputs.upload_url }} 48 | asset_path: ./mvn-build/graylog-plugin/target/jsm-graylog-plugin-${{ github.event.inputs.release-version }}.zip 49 | asset_name: jsm-graylog-plugin-${{ github.event.inputs.release-version }}.zip 50 | asset_content_type: application/zip -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/chardet/charsetprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # 13 | # This library is free software; you can redistribute it and/or 14 | # modify it under the terms of the GNU Lesser General Public 15 | # License as published by the Free Software Foundation; either 16 | # version 2.1 of the License, or (at your option) any later version. 17 | # 18 | # This library is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | # Lesser General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU Lesser General Public 24 | # License along with this library; if not, write to the Free Software 25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 26 | # 02110-1301 USA 27 | ######################### END LICENSE BLOCK ######################### 28 | 29 | from . import constants 30 | import re 31 | 32 | 33 | class CharSetProber: 34 | def __init__(self): 35 | pass 36 | 37 | def reset(self): 38 | self._mState = constants.eDetecting 39 | 40 | def get_charset_name(self): 41 | return None 42 | 43 | def feed(self, aBuf): 44 | pass 45 | 46 | def get_state(self): 47 | return self._mState 48 | 49 | def get_confidence(self): 50 | return 0.0 51 | 52 | def filter_high_bit_only(self, aBuf): 53 | aBuf = re.sub(b'([\x00-\x7F])+', b' ', aBuf) 54 | return aBuf 55 | 56 | def filter_without_english_letters(self, aBuf): 57 | aBuf = re.sub(b'([A-Za-z])+', b' ', aBuf) 58 | return aBuf 59 | 60 | def filter_with_english_letters(self, aBuf): 61 | # TODO 62 | return aBuf 63 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/chardet/mbcsgroupprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # Proofpoint, Inc. 13 | # 14 | # This library is free software; you can redistribute it and/or 15 | # modify it under the terms of the GNU Lesser General Public 16 | # License as published by the Free Software Foundation; either 17 | # version 2.1 of the License, or (at your option) any later version. 18 | # 19 | # This library is distributed in the hope that it will be useful, 20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 22 | # Lesser General Public License for more details. 23 | # 24 | # You should have received a copy of the GNU Lesser General Public 25 | # License along with this library; if not, write to the Free Software 26 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 27 | # 02110-1301 USA 28 | ######################### END LICENSE BLOCK ######################### 29 | 30 | from .charsetgroupprober import CharSetGroupProber 31 | from .utf8prober import UTF8Prober 32 | from .sjisprober import SJISProber 33 | from .eucjpprober import EUCJPProber 34 | from .gb2312prober import GB2312Prober 35 | from .euckrprober import EUCKRProber 36 | from .cp949prober import CP949Prober 37 | from .big5prober import Big5Prober 38 | from .euctwprober import EUCTWProber 39 | 40 | 41 | class MBCSGroupProber(CharSetGroupProber): 42 | def __init__(self): 43 | CharSetGroupProber.__init__(self) 44 | self._mProbers = [ 45 | UTF8Prober(), 46 | SJISProber(), 47 | EUCJPProber(), 48 | GB2312Prober(), 49 | EUCKRProber(), 50 | CP949Prober(), 51 | Big5Prober(), 52 | EUCTWProber() 53 | ] 54 | self.reset() 55 | -------------------------------------------------------------------------------- /graylog-plugin/src/main/java/com/atlassian/plugin/graylog/alertapi/CreateAlertRequest.java: -------------------------------------------------------------------------------- 1 | package com.atlassian.plugin.graylog.alertapi; 2 | 3 | import com.fasterxml.jackson.annotation.JsonInclude; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | 6 | import java.util.List; 7 | import java.util.Map; 8 | 9 | @JsonInclude(JsonInclude.Include.NON_NULL) 10 | public class CreateAlertRequest { 11 | 12 | @JsonProperty("message") 13 | private String message; 14 | 15 | @JsonProperty("teams") 16 | private List teams; 17 | 18 | @JsonProperty("tags") 19 | private List tags; 20 | 21 | @JsonProperty("description") 22 | private String description; 23 | 24 | @JsonProperty("details") 25 | private Map details; 26 | 27 | @JsonProperty("priority") 28 | private String priority; 29 | 30 | public String getMessage() { 31 | return message; 32 | } 33 | 34 | public void setMessage(String message) { 35 | this.message = message; 36 | } 37 | 38 | public List getTeams() { 39 | return teams; 40 | } 41 | 42 | public void setTeams(List teams) { 43 | this.teams = teams; 44 | } 45 | 46 | public List getTags() { 47 | return tags; 48 | } 49 | 50 | public void setTags(List tags) { 51 | this.tags = tags; 52 | } 53 | 54 | public String getDescription() { 55 | return description; 56 | } 57 | 58 | public void setDescription(String description) { 59 | this.description = description; 60 | } 61 | 62 | public Map getDetails() { 63 | return details; 64 | } 65 | 66 | public void setDetails(Map details) { 67 | this.details = details; 68 | } 69 | 70 | public String getPriority() { 71 | return priority; 72 | } 73 | 74 | public void setPriority(String priority) { 75 | this.priority = priority; 76 | } 77 | 78 | public static class TeamRecipient { 79 | 80 | @JsonProperty("name") 81 | private String name; 82 | 83 | public String getName() { 84 | return name; 85 | } 86 | 87 | public void setName(String name) { 88 | this.name = name; 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /nagios/conf/jec-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiKey": "", 3 | "baseUrl": "https://api.atlassian.com", 4 | "logLevel": "DEBUG", 5 | "globalArgs": [ 6 | "" 7 | ], 8 | "globalFlags": { 9 | "alert_histogram_image_url": "http://localhost/nagios/cgi-bin/histogram.cgi", 10 | "trends_image_url": "http://localhost/nagios/cgi-bin/trends.cgi", 11 | "command_url": "http://localhost/nagios/cgi-bin/cmd.cgi", 12 | "user": "nagiosadmin", 13 | "password": "admin" 14 | }, 15 | "actionMappings": { 16 | "Create": { 17 | "filepath": "", 18 | "sourceType": "local", 19 | "env": [ 20 | "e1=v1", 21 | "e2=v2" 22 | ], 23 | "stdout": "" 24 | }, 25 | "Acknowledge": { 26 | "filepath": "", 27 | "sourceType": "local", 28 | "env": [ 29 | "e1=v1", 30 | "e2=v2" 31 | ], 32 | "stdout": "" 33 | }, 34 | "AddNote": { 35 | "filepath": "", 36 | "sourceType": "local", 37 | "env": [ 38 | "e1=v1", 39 | "e2=v2" 40 | ], 41 | "stdout": "" 42 | }, 43 | "TakeOwnership": { 44 | "filepath": "", 45 | "sourceType": "local", 46 | "env": [ 47 | "e1=v1", 48 | "e2=v2" 49 | ], 50 | "stdout": "" 51 | }, 52 | "AssignOwnership": { 53 | "filepath": "", 54 | "sourceType": "local", 55 | "env": [ 56 | "e1=v1", 57 | "e2=v2" 58 | ], 59 | "stdout": "" 60 | }, 61 | "UnAcknowledge": { 62 | "filepath": "", 63 | "sourceType": "local", 64 | "env": [ 65 | "e1=v1", 66 | "e2=v2" 67 | ], 68 | "stdout": "" 69 | } 70 | }, 71 | "pollerConf": { 72 | "pollingWaitIntervalInMillis": 100, 73 | "visibilityTimeoutInSec": 30, 74 | "maxNumberOfMessages": 10 75 | }, 76 | "poolConf": { 77 | "maxNumberOfWorker": 12, 78 | "minNumberOfWorker": 4, 79 | "monitoringPeriodInMillis": 15000, 80 | "keepAliveTimeInMillis": 6000, 81 | "queueSize": 0 82 | } 83 | } -------------------------------------------------------------------------------- /bmc-remedy/conf/integration.conf: -------------------------------------------------------------------------------- 1 | apiKey = YOUR_API_KEY 2 | jsm.api.url = https://api.atlassian.com 3 | 4 | ######################################## PROXY SERVER CONFIGURATION ############################################ 5 | #http.proxy.server.enabled=false 6 | #http.proxy.server.port=11111 7 | #http.proxy.server.host=localhost 8 | #http.proxy.server.username=admin 9 | #http.proxy.server.password=changeme 10 | 11 | ######################################## PROXY CONFIGURATION FOR EXTERNAL HTTP REQUESTS FROM MARID############## 12 | #http.proxy.enabled=false 13 | #http.proxy.host= 14 | #http.proxy.port= 15 | #http.proxy.username= 16 | #http.proxy.password= 17 | #http.proxy.protocol= 18 | #http.proxy.authMethod= 19 | 20 | ######################################## HTTP SERVER CONFIGURATION ############################################ 21 | #maridKey=changeme 22 | #http.server.enabled=true 23 | #http.server.host=localhost 24 | #http.server.port=8080 25 | #http.server.maxContentLength=2000000 26 | 27 | #async.script.shutdown.wait.time=90000 28 | #async.script.executor.thread.count=20 29 | #async.script.executor.queue.count=10000 30 | 31 | ######################################## HTTPS SERVER CONFIGURATION ############################################ 32 | #https.server.enabled=true 33 | #https.server.host=localhost 34 | #https.server.port=8443 35 | #https.server.maxContentLength=2000000 36 | 37 | #######################################ALERT ACTION SCRIPT CONFIGURATION ##################################### 38 | #actions..script= 39 | ############################################################################################################## 40 | ####################################### BMC REMEDY CONFIGURATION ####################################### 41 | bmcRemedy.midtierServerUrl= 42 | bmcRemedy.username= 43 | bmcRemedy.password= 44 | bmcRemedy.serverName= 45 | bmcRemedy2jsm.logger=warning 46 | 47 | ####################################### PROXY CONFIGURATION FOR BMC REMEDY ############################################ 48 | bmcRemedy2jsm.http.proxy.enabled=false 49 | bmcRemedy2jsm.http.proxy.port=11111 50 | bmcRemedy2jsm.http.proxy.host=localhost 51 | bmcRemedy2jsm.http.proxy.protocol=http 52 | #bmcRemedy2jsm.http.proxy.username=admin 53 | #bmcRemedy2jsm.http.proxy.password=changeme -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/urllib3/util/request.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from base64 import b64encode 3 | 4 | from ..packages.six import b 5 | 6 | ACCEPT_ENCODING = 'gzip,deflate' 7 | 8 | 9 | def make_headers(keep_alive=None, accept_encoding=None, user_agent=None, 10 | basic_auth=None, proxy_basic_auth=None, disable_cache=None): 11 | """ 12 | Shortcuts for generating request headers. 13 | 14 | :param keep_alive: 15 | If ``True``, adds 'connection: keep-alive' header. 16 | 17 | :param accept_encoding: 18 | Can be a boolean, list, or string. 19 | ``True`` translates to 'gzip,deflate'. 20 | List will get joined by comma. 21 | String will be used as provided. 22 | 23 | :param user_agent: 24 | String representing the user-agent you want, such as 25 | "python-urllib3/0.6" 26 | 27 | :param basic_auth: 28 | Colon-separated username:password string for 'authorization: basic ...' 29 | auth header. 30 | 31 | :param proxy_basic_auth: 32 | Colon-separated username:password string for 'proxy-authorization: basic ...' 33 | auth header. 34 | 35 | :param disable_cache: 36 | If ``True``, adds 'cache-control: no-cache' header. 37 | 38 | Example:: 39 | 40 | >>> make_headers(keep_alive=True, user_agent="Batman/1.0") 41 | {'connection': 'keep-alive', 'user-agent': 'Batman/1.0'} 42 | >>> make_headers(accept_encoding=True) 43 | {'accept-encoding': 'gzip,deflate'} 44 | """ 45 | headers = {} 46 | if accept_encoding: 47 | if isinstance(accept_encoding, str): 48 | pass 49 | elif isinstance(accept_encoding, list): 50 | accept_encoding = ','.join(accept_encoding) 51 | else: 52 | accept_encoding = ACCEPT_ENCODING 53 | headers['accept-encoding'] = accept_encoding 54 | 55 | if user_agent: 56 | headers['user-agent'] = user_agent 57 | 58 | if keep_alive: 59 | headers['connection'] = 'keep-alive' 60 | 61 | if basic_auth: 62 | headers['authorization'] = 'Basic ' + \ 63 | b64encode(b(basic_auth)).decode('utf-8') 64 | 65 | if proxy_basic_auth: 66 | headers['proxy-authorization'] = 'Basic ' + \ 67 | b64encode(b(proxy_basic_auth)).decode('utf-8') 68 | 69 | if disable_cache: 70 | headers['cache-control'] = 'no-cache' 71 | 72 | return headers 73 | -------------------------------------------------------------------------------- /connectwise-automate/conf/JSMAlert.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 377 9 | 34 10 | Jira Service Management Alert 11 | Please, paste your API key in Globals and Parameters tab, then save. 12 | 0, 13 | 0, 14 | 1 15 | 0 16 | 0 17 | 1 18 | H4sIAAAAAAAEAFWPTQrCMBSE94J3yAEa0gSjoTwC4t9GN1bct8kLZGEa0hTs7aVFoa6GmeEbGLh6g6HHY5MbDY8xoubAZoX7EA7dEDImXQJbODi9o08Tg/qcvG3GgtQYM75aTETwgoiSK8J5VapKbMj+BmyBQG2Sj/mJqfddmLb/g29/GbzVW+kUN9bR1ipHOUdFlRQ7WjbWSCGdUYg/fgaALR+tVx/sr8Vz4QAAAA== 19 | H4sIAAAAAAAEAM1WUW/TMBB+r9T/YEWd2MSyrN0KFbSlMOg2YGxaBzxMe3CT62qW2iF2NibEf8d3cdIksL0h8eS7+86+83dfnQ5nYSoS85YbPm63GBvmvibHuu9+mJQjOhUQR5oFBXDGU74CA2kldhirOY/1mCfiA9yPEq4N+JoO9JeQwjZko6lNgGFQpLqdedUv9jSh5Lg7DOqBWtZhJqLxs/5i0A2jhT+PBgu/24WBP+j3nvu7PAr7vf4iHAAUp9AGulxQvZ07bmYgKft4HRrXgLNcfJpJ8o8jxCpelY1ug51ew99r+PsNv7/2Zyo1413bL64udqCkETIDjJe2w071R7EStKUwHXIsI5CG02UsWnWrlKxZeISW3iO09Pb6DxODlZ1VI2ic4MI2MXipTSrk9VUHMjZiHunE264hua4Qza0GrO29Mo1wbjXgMBb26tKqFlNyr5miVklmNV0mOb+RFquQGCzSCr+RtsCfTJFDTiMhBZ3FBtHcasB3S5AI4vpHo3aIoflU9kluI2mlpDAqLZKc67VbW+0WJorFJpLtw3fmXaQZeFvsJ8Y7WSpww9KYRL8IAkv2DmQ7KtHXIAXsWFaC227wTSsZCGngOqXb6+AO5kulbnRg+5EQmjuhgWdGrbiBV+5R8NhT5gb5st361W6BnfPDdf9R0XarM1cRSsn+km4hNRfKf2+PZhPqpFSS0xTGcsE4MitiIszppEQrOkK8EEiBVwWEOImjAEvZIFJKxIkFY04XpI+8elUMVW0gWldBVRTERGcJPMJXfMQuj7heGj6P4crxwNjFfYLbnvAkiUXeNM3gid1sqVxL+Fjeqhvwz0GbEzBLFTHfrd6Z0sZj/mc7XRqxf+RKlrX9NziMfCQ+vm2WW6r8t7pfU2E/K6eZsRSvaXEPTK/+4o69CWQTj3mTfPpkzmimaG6sx7hBbmVuFKgOCgOTaTEcOumcitNJOAzacrCmn3ac5IRPPNfhXv0bUD6N+//dt6Dw3Z+D30mmC+4rCAAA 20 | 1 21 | 65f81cdf-bd8f-11e8-8527-0adc525fc8ee 22 | 0 23 | 24 |
25 |
26 | 27 | 28 | 29 | 34 30 | 0 31 | Software 32 | 31866f37-8f0a-47b9-b1fd-11bd855f8391 33 |
34 |
35 |
36 |
37 |
38 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/urllib3/util/response.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from ..packages.six.moves import http_client as httplib 3 | 4 | from ..exceptions import HeaderParsingError 5 | 6 | 7 | def is_fp_closed(obj): 8 | """ 9 | Checks whether a given file-like object is closed. 10 | 11 | :param obj: 12 | The file-like object to check. 13 | """ 14 | 15 | try: 16 | # Check via the official file-like-object way. 17 | return obj.closed 18 | except AttributeError: 19 | pass 20 | 21 | try: 22 | # Check if the object is a container for another file-like object that 23 | # gets released on exhaustion (e.g. HTTPResponse). 24 | return obj.fp is None 25 | except AttributeError: 26 | pass 27 | 28 | raise ValueError("Unable to determine whether fp is closed.") 29 | 30 | 31 | def assert_header_parsing(headers): 32 | """ 33 | Asserts whether all headers have been successfully parsed. 34 | Extracts encountered errors from the result of parsing headers. 35 | 36 | Only works on Python 3. 37 | 38 | :param headers: Headers to verify. 39 | :type headers: `httplib.HTTPMessage`. 40 | 41 | :raises urllib3.exceptions.HeaderParsingError: 42 | If parsing errors are found. 43 | """ 44 | 45 | # This will fail silently if we pass in the wrong kind of parameter. 46 | # To make debugging easier add an explicit check. 47 | if not isinstance(headers, httplib.HTTPMessage): 48 | raise TypeError('expected httplib.Message, got {0}.'.format( 49 | type(headers))) 50 | 51 | defects = getattr(headers, 'defects', None) 52 | get_payload = getattr(headers, 'get_payload', None) 53 | 54 | unparsed_data = None 55 | if get_payload: # Platform-specific: Python 3. 56 | unparsed_data = get_payload() 57 | 58 | if defects or unparsed_data: 59 | raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data) 60 | 61 | 62 | def is_response_to_head(response): 63 | """ 64 | Checks whether the request of a response has been a HEAD-request. 65 | Handles the quirks of AppEngine. 66 | 67 | :param conn: 68 | :type conn: :class:`httplib.HTTPResponse` 69 | """ 70 | # FIXME: Can we do this somehow without accessing private httplib _method? 71 | method = response._method 72 | if isinstance(method, int): # Platform-specific: Appengine 73 | return method == 3 74 | return method.upper() == 'HEAD' 75 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Code of Conduct 2 | 3 | As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. 4 | 5 | We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality. 6 | 7 | Examples of unacceptable behavior by participants include: 8 | 9 | * The use of sexualized language or imagery 10 | * Personal attacks 11 | * Trolling or insulting/derogatory comments 12 | * Public or private harassment 13 | * Publishing other's private information, such as physical or electronic addresses, without explicit permission 14 | * Submitting contributions or comments that you know to violate the intellectual property or privacy rights of others 15 | * Other unethical or unprofessional conduct 16 | 17 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 18 | By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team. 19 | 20 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. 21 | 22 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting a project maintainer. Complaints will result in a response and be reviewed and investigated in a way that is deemed necessary and appropriate to the circumstances. Maintainers are obligated to maintain confidentiality with regard to the reporter of an incident. 23 | 24 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.3.0, available at [http://contributor-covenant.org/version/1/3/0/][version] 25 | 26 | [homepage]: http://contributor-covenant.org 27 | [version]: http://contributor-covenant.org/version/1/3/0/ -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # __ 4 | # /__) _ _ _ _ _/ _ 5 | # / ( (- (/ (/ (- _) / _) 6 | # / 7 | 8 | """ 9 | Requests HTTP library 10 | ~~~~~~~~~~~~~~~~~~~~~ 11 | 12 | Requests is an HTTP library, written in Python, for human beings. Basic GET 13 | usage: 14 | 15 | >>> import requests 16 | >>> r = requests.get('https://www.python.org') 17 | >>> r.status_code 18 | 200 19 | >>> 'Python is a programming language' in r.content 20 | True 21 | 22 | ... or POST: 23 | 24 | >>> payload = dict(key1='value1', key2='value2') 25 | >>> r = requests.post('http://httpbin.org/post', data=payload) 26 | >>> print(r.text) 27 | { 28 | ... 29 | "form": { 30 | "key2": "value2", 31 | "key1": "value1" 32 | }, 33 | ... 34 | } 35 | 36 | The other HTTP methods are supported - see `requests.api`. Full documentation 37 | is at . 38 | 39 | :copyright: (c) 2016 by Kenneth Reitz. 40 | :license: Apache 2.0, see LICENSE for more details. 41 | """ 42 | 43 | __title__ = 'requests' 44 | __version__ = '2.11.1' 45 | __build__ = 0x021101 46 | __author__ = 'Kenneth Reitz' 47 | __license__ = 'Apache 2.0' 48 | __copyright__ = 'Copyright 2016 Kenneth Reitz' 49 | 50 | # Attempt to enable urllib3's SNI support, if possible 51 | try: 52 | from .packages.urllib3.contrib import pyopenssl 53 | pyopenssl.inject_into_urllib3() 54 | except ImportError: 55 | pass 56 | 57 | import warnings 58 | 59 | # urllib3's DependencyWarnings should be silenced. 60 | from .packages.urllib3.exceptions import DependencyWarning 61 | warnings.simplefilter('ignore', DependencyWarning) 62 | 63 | from . import utils 64 | from .models import Request, Response, PreparedRequest 65 | from .api import request, get, head, post, patch, put, delete, options 66 | from .sessions import session, Session 67 | from .status_codes import codes 68 | from .exceptions import ( 69 | RequestException, Timeout, URLRequired, 70 | TooManyRedirects, HTTPError, ConnectionError, 71 | FileModeWarning, ConnectTimeout, ReadTimeout 72 | ) 73 | 74 | # Set default logging handler to avoid "No handler found" warnings. 75 | import logging 76 | try: # Python 2.7+ 77 | from logging import NullHandler 78 | except ImportError: 79 | class NullHandler(logging.Handler): 80 | def emit(self, record): 81 | pass 82 | 83 | logging.getLogger(__name__).addHandler(NullHandler()) 84 | 85 | # FileModeWarnings go off per the default. 86 | warnings.simplefilter('default', FileModeWarning, append=True) 87 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/chardet/codingstatemachine.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .constants import eStart 29 | from .compat import wrap_ord 30 | 31 | 32 | class CodingStateMachine: 33 | def __init__(self, sm): 34 | self._mModel = sm 35 | self._mCurrentBytePos = 0 36 | self._mCurrentCharLen = 0 37 | self.reset() 38 | 39 | def reset(self): 40 | self._mCurrentState = eStart 41 | 42 | def next_state(self, c): 43 | # for each byte we get its class 44 | # if it is first byte, we also get byte length 45 | # PY3K: aBuf is a byte stream, so c is an int, not a byte 46 | byteCls = self._mModel['classTable'][wrap_ord(c)] 47 | if self._mCurrentState == eStart: 48 | self._mCurrentBytePos = 0 49 | self._mCurrentCharLen = self._mModel['charLenTable'][byteCls] 50 | # from byte's class and stateTable, we get its next state 51 | curr_state = (self._mCurrentState * self._mModel['classFactor'] 52 | + byteCls) 53 | self._mCurrentState = self._mModel['stateTable'][curr_state] 54 | self._mCurrentBytePos += 1 55 | return self._mCurrentState 56 | 57 | def get_current_charlen(self): 58 | return self._mCurrentCharLen 59 | 60 | def get_coding_state_machine(self): 61 | return self._mModel['name'] 62 | -------------------------------------------------------------------------------- /logstash-plugin/spec/outputs/jsm_spec.rb: -------------------------------------------------------------------------------- 1 | require "logstash/devutils/rspec/spec_helper" 2 | require "logstash/outputs/jsm" 3 | require "logstash/codecs/plain" 4 | require "logstash/event" 5 | 6 | describe LogStash::Outputs::Jsm do 7 | 8 | subject {LogStash::Outputs::Jsm.new("apiKey" => "my_api_key" )} 9 | let(:logger) { subject.logger} 10 | 11 | describe "receive message" do 12 | 13 | it "when jsmAction is not specified" do 14 | expect(logger).to receive(:warn).with("No JSM action defined").once 15 | subject.receive({"message" => "test_alert","@version" => "1","@timestamp" => "2015-09-22T11:20:00.250Z"}) 16 | end 17 | 18 | it "when jsmAction is not valid" do 19 | action = "invalid" 20 | expect(logger).to receive(:warn).with("Action #{action} does not match any available action, discarding..").once 21 | subject.receive({"message" => "test_alert","@version" => "1","@timestamp" => "2015-09-22T11:20:00.250Z", "jsmAction" => action}) 22 | end 23 | 24 | it "when jsmAction is 'create'" do 25 | event = {"message" => "test_alert", "@version" => "1", "@timestamp" => "2015-09-22T11:20:00.250Z", "jsmAction" => "create"} 26 | expect(logger).to receive(:info).with("processing #{event}").once 27 | expect(logger).to receive(:info).with("Executing url #{subject.jsmBaseUrl}#{subject.createActionUrl}").once 28 | subject.receive(event) 29 | end 30 | 31 | it "when jsmAction is 'close'" do 32 | event = {"message" => "test_alert", "@version" => "1", "@timestamp" => "2015-09-22T11:20:00.250Z", "jsmAction" => "close"} 33 | expect(logger).to receive(:info).with("processing #{event}").once 34 | expect(logger).to receive(:info).with("Executing url #{subject.jsmBaseUrl}#{subject.closeActionUrl}").once 35 | subject.receive(event) 36 | end 37 | 38 | it "when jsmAction is 'acknowledge'" do 39 | event = {"message" => "test_alert", "@version" => "1", "@timestamp" => "2015-09-22T11:20:00.250Z", "jsmAction" => "acknowledge"} 40 | expect(logger).to receive(:info).with("processing #{event}").once 41 | expect(logger).to receive(:info).with("Executing url #{subject.jsmBaseUrl}#{subject.acknowledgeActionUrl}").once 42 | subject.receive(event) 43 | end 44 | 45 | it "when jsmAction is 'note'" do 46 | event = {"message" => "test_alert", "@version" => "1", "@timestamp" => "2015-09-22T11:20:00.250Z", "jsmAction" => "note"} 47 | expect(logger).to receive(:info).with("processing #{event}").once 48 | expect(logger).to receive(:info).with("Executing url #{subject.jsmBaseUrl}#{subject.noteActionUrl}").once 49 | subject.receive(event) 50 | end 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /release/integration-builder/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /release/integration-builder/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'com.netflix.nebula:gradle-ospackage-plugin:2.0.3' 8 | } 9 | } 10 | 11 | plugins { 12 | id "nebula.os-package-base" version "2.0.3" 13 | } 14 | apply plugin: 'java' 15 | apply plugin: 'groovy' 16 | 17 | sourceCompatibility = 1.6 18 | targetCompatibility = 1.6 19 | 20 | group = "com.atlassian.jsm-integration" 21 | 22 | project.ext.versions = new groovy.json.JsonSlurper().parseText(file("${projectDir}/version.json").text) 23 | project.ext.versionSuffix = '' 24 | 25 | subprojects { 26 | apply plugin: 'java' 27 | apply plugin: 'groovy' 28 | apply plugin: 'maven' 29 | 30 | sourceCompatibility = 1.6 31 | targetCompatibility = 1.6 32 | 33 | group = "com.atlassian.jsm.integration" 34 | version = rootProject.version 35 | project.ext.versions = new groovy.json.JsonSlurper().parseText(file("${rootProject.projectDir}/version.json").text) 36 | 37 | if (project.ext.versions[name] != null) { 38 | version = project.ext.versions[name] 39 | } 40 | 41 | project.ext.versionSuffix = '' 42 | 43 | 44 | repositories { 45 | mavenCentral() 46 | maven { 47 | url "https://packages.atlassian.com/maven-3rdparty/" 48 | } 49 | } 50 | 51 | test.onlyIf { 52 | false 53 | } 54 | 55 | jar { 56 | manifest { 57 | attributes("Built-By": "http://www.atlassian.com", 58 | "Specification-Title": project.name[0].toUpperCase() + project.name[1..-1], 59 | "Specification-Product": project.name, 60 | "Specification-Version": project.version, 61 | "Specification-Vendor": "http://www.atlassian.com", 62 | "Implementation-Title": project.name[0].toUpperCase() + project.name[1..-1], 63 | "Implementation-Product": project.name, 64 | "Implementation-Vendor": "http://www.atlassian.com", 65 | "Implementation-Version": project.version, 66 | ) 67 | } 68 | } 69 | } 70 | 71 | repositories { 72 | mavenCentral() 73 | maven { 74 | url "https://packages.atlassian.com/maven-3rdparty/" 75 | } 76 | } 77 | 78 | configurations { 79 | netcool 80 | debian 81 | } 82 | 83 | dependencies { 84 | netcool 'com.sybase.jdbc:sybase:5.5.OG' 85 | debian 'org.vafer:jdeb:1.3' 86 | } 87 | 88 | 89 | task wrapper(type: Wrapper) { 90 | gradleVersion = '2.2' 91 | } 92 | 93 | //apply scripts 94 | apply from: 'oem/oem.gradle' 95 | apply from: 'opsview/opsview.gradle' 96 | apply from: 'vcenter/vcenter.gradle' 97 | apply from: 'vcsa/vcsa.gradle' 98 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/urllib3/filepost.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | import codecs 3 | 4 | from uuid import uuid4 5 | from io import BytesIO 6 | 7 | from .packages import six 8 | from .packages.six import b 9 | from .fields import RequestField 10 | 11 | writer = codecs.lookup('utf-8')[3] 12 | 13 | 14 | def choose_boundary(): 15 | """ 16 | Our embarassingly-simple replacement for mimetools.choose_boundary. 17 | """ 18 | return uuid4().hex 19 | 20 | 21 | def iter_field_objects(fields): 22 | """ 23 | Iterate over fields. 24 | 25 | Supports list of (k, v) tuples and dicts, and lists of 26 | :class:`~urllib3.fields.RequestField`. 27 | 28 | """ 29 | if isinstance(fields, dict): 30 | i = six.iteritems(fields) 31 | else: 32 | i = iter(fields) 33 | 34 | for field in i: 35 | if isinstance(field, RequestField): 36 | yield field 37 | else: 38 | yield RequestField.from_tuples(*field) 39 | 40 | 41 | def iter_fields(fields): 42 | """ 43 | .. deprecated:: 1.6 44 | 45 | Iterate over fields. 46 | 47 | The addition of :class:`~urllib3.fields.RequestField` makes this function 48 | obsolete. Instead, use :func:`iter_field_objects`, which returns 49 | :class:`~urllib3.fields.RequestField` objects. 50 | 51 | Supports list of (k, v) tuples and dicts. 52 | """ 53 | if isinstance(fields, dict): 54 | return ((k, v) for k, v in six.iteritems(fields)) 55 | 56 | return ((k, v) for k, v in fields) 57 | 58 | 59 | def encode_multipart_formdata(fields, boundary=None): 60 | """ 61 | Encode a dictionary of ``fields`` using the multipart/form-data MIME format. 62 | 63 | :param fields: 64 | Dictionary of fields or list of (key, :class:`~urllib3.fields.RequestField`). 65 | 66 | :param boundary: 67 | If not specified, then a random boundary will be generated using 68 | :func:`mimetools.choose_boundary`. 69 | """ 70 | body = BytesIO() 71 | if boundary is None: 72 | boundary = choose_boundary() 73 | 74 | for field in iter_field_objects(fields): 75 | body.write(b('--%s\r\n' % (boundary))) 76 | 77 | writer(body).write(field.render_headers()) 78 | data = field.data 79 | 80 | if isinstance(data, int): 81 | data = str(data) # Backwards compatibility 82 | 83 | if isinstance(data, six.text_type): 84 | writer(body).write(data) 85 | else: 86 | body.write(data) 87 | 88 | body.write(b'\r\n') 89 | 90 | body.write(b('--%s--\r\n' % (boundary))) 91 | 92 | content_type = str('multipart/form-data; boundary=%s' % boundary) 93 | 94 | return body.getvalue(), content_type 95 | -------------------------------------------------------------------------------- /amazon-security-hub/conf/securityhub-outgoing-permission-template.json: -------------------------------------------------------------------------------- 1 | { 2 | "AWSTemplateFormatVersion": "2010-09-09", 3 | "Description": "Jira Service Management - AmazonSecurityHub", 4 | "Parameters": { 5 | "IntegrationApiKey": { 6 | "Type": "String", 7 | "Description": "Jira Service Management SecurityHub Integration Api Key" 8 | }, 9 | "RoleName": { 10 | "Type": "String", 11 | "Description": "IAM role name, follow this naming convention `jsmSecurityHubRole*`" 12 | } 13 | }, 14 | "Resources": { 15 | "jsmSecurityHubRole": { 16 | "Type": "AWS::IAM::Role", 17 | "Properties": { 18 | "AssumeRolePolicyDocument": { 19 | "Version": "2012-10-17", 20 | "Statement": [ 21 | { 22 | "Effect": "Allow", 23 | "Principal": { 24 | "AWS": [ 25 | "arn:aws:iam::089311581210:role/jsm-securityhub-app", 26 | "arn:aws:iam::401089113854:role/jsm-securityhub-app", 27 | "arn:aws:iam::838921230308:role/jsm-securityhub-app", 28 | "arn:aws:iam::028860521379:role/jsm-securityhub-app" 29 | ] 30 | }, 31 | "Action": "sts:AssumeRole", 32 | "Condition": { 33 | "StringEquals": { 34 | "sts:ExternalId": [ 35 | { 36 | "Ref": "IntegrationApiKey" 37 | } 38 | ] 39 | } 40 | } 41 | } 42 | ] 43 | }, 44 | "Description": "IAM role to allow Jira Service Management to access security hub", 45 | "Policies": [ 46 | { 47 | "PolicyName": "jsmSecurityHubPolicy", 48 | "PolicyDocument": { 49 | "Version": "2012-10-17", 50 | "Statement": [ 51 | { 52 | "Sid": "VisualEditor0", 53 | "Effect": "Allow", 54 | "Action": [ 55 | "securityhub:GetFindings", 56 | "securityhub:BatchUpdateFindings" 57 | ], 58 | "Resource": [ 59 | "arn:aws:securityhub:*:*:*" 60 | ] 61 | } 62 | ] 63 | } 64 | } 65 | ], 66 | "RoleName": { 67 | "Ref": "RoleName" 68 | } 69 | } 70 | } 71 | }, 72 | "Outputs": { 73 | "JsmSecurityHubRoleName": { 74 | "Value": { 75 | "Ref": "jsmSecurityHubRole" 76 | } 77 | }, 78 | "JsmSecurityHubRoleARN": { 79 | "Value": { 80 | "Fn::GetAtt": [ 81 | "jsmSecurityHubRole", 82 | "Arn" 83 | ] 84 | } 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/chardet/chardetect.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Script which takes one or more file paths and reports on their detected 4 | encodings 5 | 6 | Example:: 7 | 8 | % chardetect somefile someotherfile 9 | somefile: windows-1252 with confidence 0.5 10 | someotherfile: ascii with confidence 1.0 11 | 12 | If no paths are provided, it takes its input from stdin. 13 | 14 | """ 15 | 16 | from __future__ import absolute_import, print_function, unicode_literals 17 | 18 | import argparse 19 | import sys 20 | from io import open 21 | 22 | from chardet import __version__ 23 | from chardet.universaldetector import UniversalDetector 24 | 25 | 26 | def description_of(lines, name='stdin'): 27 | """ 28 | Return a string describing the probable encoding of a file or 29 | list of strings. 30 | 31 | :param lines: The lines to get the encoding of. 32 | :type lines: Iterable of bytes 33 | :param name: Name of file or collection of lines 34 | :type name: str 35 | """ 36 | u = UniversalDetector() 37 | for line in lines: 38 | u.feed(line) 39 | u.close() 40 | result = u.result 41 | if result['encoding']: 42 | return '{0}: {1} with confidence {2}'.format(name, result['encoding'], 43 | result['confidence']) 44 | else: 45 | return '{0}: no result'.format(name) 46 | 47 | 48 | def main(argv=None): 49 | ''' 50 | Handles command line arguments and gets things started. 51 | 52 | :param argv: List of arguments, as if specified on the command-line. 53 | If None, ``sys.argv[1:]`` is used instead. 54 | :type argv: list of str 55 | ''' 56 | # Get command line arguments 57 | parser = argparse.ArgumentParser( 58 | description="Takes one or more file paths and reports their detected \ 59 | encodings", 60 | formatter_class=argparse.ArgumentDefaultsHelpFormatter, 61 | conflict_handler='resolve') 62 | parser.add_argument('input', 63 | help='File whose encoding we would like to determine.', 64 | type=argparse.FileType('rb'), nargs='*', 65 | default=[sys.stdin]) 66 | parser.add_argument('--version', action='version', 67 | version='%(prog)s {0}'.format(__version__)) 68 | args = parser.parse_args(argv) 69 | 70 | for f in args.input: 71 | if f.isatty(): 72 | print("You are running chardetect interactively. Press " + 73 | "CTRL-D twice at the start of a blank line to signal the " + 74 | "end of your input. If you want help, run chardetect " + 75 | "--help\n", file=sys.stderr) 76 | print(description_of(f, f.name)) 77 | 78 | 79 | if __name__ == '__main__': 80 | main() 81 | -------------------------------------------------------------------------------- /solarwinds-npm/conf/trigger-action-body.txt: -------------------------------------------------------------------------------- 1 | ## Jira Service Management expects the following fields like below, use them without changing names (in both contents) 2 | ## you can send alias, responders and tags to be used in Jira Service Management alerts. Notice that these fields start with lowercase in example content do not change it.d 3 | ActionType=Create& 4 | alias=${N=Alerting;M=AlertObjectID}-${N=Alerting;M=AlertID}& 5 | ObjectID=${N=Alerting;M=AlertObjectID}& 6 | NodeName=${NodeName}& 7 | AlertID=${N=Alerting;M=AlertID}& 8 | AlertDefID=${N=Alerting;M=AlertDefID}& 9 | AlertName=${N=Alerting;M=AlertName}& 10 | AlertMessage=${N=Alerting;M=AlertMessage}& 11 | AlertDescription=${N=Alerting;M=AlertDescription}& 12 | AlertDetailsUrl=${N=Alerting;M=AlertDetailsUrl}& 13 | DownTime=${N=Alerting;M=DownTime}& 14 | AcknowledgeUrl=${N=Alerting;M=AcknowledgeUrl}& 15 | Acknowledged=${N=Alerting;M=Acknowledged}& 16 | AcknowledgedBy=${N=Alerting;M=AcknowledgedBy}& 17 | AcknowledgedTime=${N=Alerting;M=AcknowledgedTime;F=DateTime}& 18 | AlertTriggerCount=${N=Alerting;M=AlertTriggerCount}& 19 | AlertTriggerTime=${N=Alerting;M=AlertTriggerTime;F=DateTime}& 20 | LastEdit=${N=Alerting;M=LastEdit;F=DateTime}& 21 | ObjectType=${N=Alerting;M=ObjectType}& 22 | Severity=${N=Alerting;M=Severity}& 23 | TimeOfDay=${N=Alerting;M=TimeOfDay}& 24 | DateTime=${N=Generic;M=DateTime;F=DateTime}& 25 | responders=& 26 | tags= 27 | 28 | ## Troubleshooting content, use µ#µ instead of = and §#§ instead of & 29 | ## you can send alias, responders and tags to be used in Jira Service Management alerts. Notice that these fields start with lowercase in example content do not change it. 30 | 31 | ActionTypeµ#µCreate§#§ 32 | aliasµ#µ${N=Alerting;M=AlertObjectID}-${N=Alerting;M=AlertID}§#§ 33 | ObjectIDµ#µ${N=Alerting;M=AlertObjectID}§#§ 34 | NodeNameµ#µ${NodeName}§#§ 35 | AlertIDµ#µ${N=Alerting;M=AlertID}§#§ 36 | AlertDefIDµ#µ${N=Alerting;M=AlertDefID}§#§ 37 | AlertNameµ#µ${N=Alerting;M=AlertName}§#§ 38 | AlertMessageµ#µ${N=Alerting;M=AlertMessage}§#§ 39 | AlertDescriptionµ#µ${N=Alerting;M=AlertDescription}§#§ 40 | AlertDetailsUrlµ#µ${N=Alerting;M=AlertDetailsUrl}§#§ 41 | DownTimeµ#µ${N=Alerting;M=DownTime}§#§ 42 | AcknowledgeUrlµ#µ${N=Alerting;M=AcknowledgeUrl}§#§ 43 | Acknowledgedµ#µ${N=Alerting;M=Acknowledged}§#§ 44 | AcknowledgedByµ#µ${N=Alerting;M=AcknowledgedBy}§#§ 45 | AcknowledgedTimeµ#µ${N=Alerting;M=AcknowledgedTime;F=DateTime}§#§ 46 | AlertTriggerCountµ#µ${N=Alerting;M=AlertTriggerCount}§#§ 47 | AlertTriggerTimeµ#µ${N=Alerting;M=AlertTriggerTime;F=DateTime}§#§ 48 | LastEditµ#µ${N=Alerting;M=LastEdit;F=DateTime}§#§ 49 | ObjectTypeµ#µ${N=Alerting;M=ObjectType}§#§ 50 | Severityµ#µ${N=Alerting;M=Severity}§#§ 51 | TimeOfDayµ#µ${N=Alerting;M=TimeOfDay}§#§ 52 | DateTimeµ#µ${N=Generic;M=DateTime;F=DateTime}§#§ 53 | respondersµ#µ§#§ 54 | tagsµ#µ 55 | -------------------------------------------------------------------------------- /icinga/conf/jsm.cfg: -------------------------------------------------------------------------------- 1 | define contact { 2 | contact_name jsm 3 | alias JSM Contact 4 | service_notification_period 24x7 5 | host_notification_period 24x7 6 | service_notification_options c,r 7 | host_notification_options d,r 8 | service_notification_commands notify-service-by-jsm 9 | host_notification_commands notify-host-by-jsm 10 | } 11 | 12 | define command { 13 | command_name notify-service-by-jsm 14 | command_line /home/jsm/jec/scripts/send2jsm -entityType=service -t="$NOTIFICATIONTYPE$" -sc="$SERVICECHECKCOMMAND$" -ldt="$LONGDATETIME$" -hn="$HOSTNAME$" -hdn="$HOSTDISPLAYNAME$" -hal="$HOSTALIAS$" -haddr="$HOSTADDRESS$" -hs="$HOSTSTATE$" -hsi="$HOSTSTATEID$" -lhs="$LASTHOSTSTATE$" -lhsi="$LASTHOSTSTATEID$" -hst="$HOSTSTATETYPE$" -ha="$HOSTATTEMPT$" -mha="$MAXHOSTATTEMPTS$" -hei="$HOSTEVENTID$" -lhei="$LASTHOSTEVENTID$" -hpi="$HOSTPROBLEMID$" -lhpi="$LASTHOSTPROBLEMID$" -hl="$HOSTLATENCY$" -het="$HOSTEXECUTIONTIME$" -hd="$HOSTDURATION$" -hds="$HOSTDURATIONSEC$" -hdt="$HOSTDOWNTIME$" -hpc="$HOSTPERCENTCHANGE$" -hgn="$HOSTGROUPNAME$" -hgns="$HOSTGROUPNAMES$" -lhc="$LASTHOSTCHECK$" -lhsc="$LASTHOSTSTATECHANGE$" -lhu="$LASTHOSTUP$" -lhd="$LASTHOSTDOWN$" -lhur="$LASTHOSTUNREACHABLE$" -ho="$HOSTOUTPUT$" -lho="$LONGHOSTOUTPUT$" -hpd="$HOSTPERFDATA$" -s="$SERVICEDESC$" -sdn="$SERVICEDISPLAYNAME$" -ss="$SERVICESTATE$" -ssi="$SERVICESTATEID$" -lss="$LASTSERVICESTATE$" -lssi="$LASTSERVICESTATEID$" -sst="$SERVICESTATETYPE$" -sa="$SERVICEATTEMPT$" -msa="$MAXSERVICEATTEMPTS$" -siv="$SERVICEISVOLATILE$" -sei="$SERVICEEVENTID$" -lsei="$LASTSERVICEEVENTID$" -spi="$SERVICEPROBLEMID$" -lspi="$LASTSERVICEPROBLEMID$" -sl="$SERVICELATENCY$" -set="$SERVICEEXECUTIONTIME$" -sd="$SERVICEDURATION$" -sds="$SERVICEDURATIONSEC$" -sdt="$SERVICEDOWNTIME$" -spc="$SERVICEPERCENTCHANGE$" -sgn="$SERVICEGROUPNAME$" -sgns="$SERVICEGROUPNAMES$" -lsch="$LASTSERVICECHECK$" -lssc="$LASTSERVICESTATECHANGE$" -lsok="$LASTSERVICEOK$" -lsw="$LASTSERVICEWARNING$" -lsu="$LASTSERVICEUNKNOWN$" -lsc="$LASTSERVICECRITICAL$" -so="$SERVICEOUTPUT$" -lso="$LONGSERVICEOUTPUT$" -spd="$SERVICEPERFDATA$" 15 | } 16 | 17 | define command { 18 | command_name notify-host-by-jsm 19 | command_line /home/jsm/jec/scripts/send2jsm -entityType=host -t="$NOTIFICATIONTYPE$" -ldt="$LONGDATETIME$" -hn="$HOSTNAME$" -hdn="$HOSTDISPLAYNAME$" -hal="$HOSTALIAS$" -haddr="$HOSTADDRESS$" -hs="$HOSTSTATE$" -hsi="$HOSTSTATEID$" -lhs="$LASTHOSTSTATE$" -lhsi="$LASTHOSTSTATEID$" -hst="$HOSTSTATETYPE$" -ha="$HOSTATTEMPT$" -mha="$MAXHOSTATTEMPTS$" -hei="$HOSTEVENTID$" -lhei="$LASTHOSTEVENTID$" -hpi="$HOSTPROBLEMID$" -lhpi="$LASTHOSTPROBLEMID$" -hl="$HOSTLATENCY$" -het="$HOSTEXECUTIONTIME$" -hd="$HOSTDURATION$" -hds="$HOSTDURATIONSEC$" -hdt="$HOSTDOWNTIME$" -hpc="$HOSTPERCENTCHANGE$" -hgn="$HOSTGROUPNAME$" -hgns="$HOSTGROUPNAMES$" -lhc="$LASTHOSTCHECK$" -lhsc="$LASTHOSTSTATECHANGE$" -lhu="$LASTHOSTUP$" -lhd="$LASTHOSTDOWN$" -lhur="$LASTHOSTUNREACHABLE$" -ho="$HOSTOUTPUT$" -lho="$LONGHOSTOUTPUT$" -hpd="$HOSTPERFDATA$" 20 | } 21 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/chardet/utf8prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from . import constants 29 | from .charsetprober import CharSetProber 30 | from .codingstatemachine import CodingStateMachine 31 | from .mbcssm import UTF8SMModel 32 | 33 | ONE_CHAR_PROB = 0.5 34 | 35 | 36 | class UTF8Prober(CharSetProber): 37 | def __init__(self): 38 | CharSetProber.__init__(self) 39 | self._mCodingSM = CodingStateMachine(UTF8SMModel) 40 | self.reset() 41 | 42 | def reset(self): 43 | CharSetProber.reset(self) 44 | self._mCodingSM.reset() 45 | self._mNumOfMBChar = 0 46 | 47 | def get_charset_name(self): 48 | return "utf-8" 49 | 50 | def feed(self, aBuf): 51 | for c in aBuf: 52 | codingState = self._mCodingSM.next_state(c) 53 | if codingState == constants.eError: 54 | self._mState = constants.eNotMe 55 | break 56 | elif codingState == constants.eItsMe: 57 | self._mState = constants.eFoundIt 58 | break 59 | elif codingState == constants.eStart: 60 | if self._mCodingSM.get_current_charlen() >= 2: 61 | self._mNumOfMBChar += 1 62 | 63 | if self.get_state() == constants.eDetecting: 64 | if self.get_confidence() > constants.SHORTCUT_THRESHOLD: 65 | self._mState = constants.eFoundIt 66 | 67 | return self.get_state() 68 | 69 | def get_confidence(self): 70 | unlike = 0.99 71 | if self._mNumOfMBChar < 6: 72 | for i in range(0, self._mNumOfMBChar): 73 | unlike = unlike * ONE_CHAR_PROB 74 | return 1.0 - unlike 75 | else: 76 | return unlike 77 | -------------------------------------------------------------------------------- /nagios/conf/jsm.cfg: -------------------------------------------------------------------------------- 1 | define contact { 2 | contact_name jsm 3 | alias JSM Contact 4 | service_notification_period 24x7 5 | host_notification_period 24x7 6 | service_notification_options c,r 7 | host_notification_options d,r 8 | service_notification_commands notify-service-by-jsm 9 | host_notification_commands notify-host-by-jsm 10 | } 11 | 12 | define command { 13 | command_name notify-service-by-jsm 14 | command_line /home/jsm/jec/scripts/send2jsm -entityType=service -t="$NOTIFICATIONTYPE$" -ldt="$LONGDATETIME$" -hn="$HOSTNAME$" -hdn="$HOSTDISPLAYNAME$" -hal="$HOSTALIAS$" -haddr="$HOSTADDRESS$" -hs="$HOSTSTATE$" -hsi="$HOSTSTATEID$" -lhs="$LASTHOSTSTATE$" -lhsi="$LASTHOSTSTATEID$" -hst="$HOSTSTATETYPE$" -ha="$HOSTATTEMPT$" -mha="$MAXHOSTATTEMPTS$" -hei="$HOSTEVENTID$" -lhei="$LASTHOSTEVENTID$" -hpi="$HOSTPROBLEMID$" -lhpi="$LASTHOSTPROBLEMID$" -hl="$HOSTLATENCY$" -het="$HOSTEXECUTIONTIME$" -hd="$HOSTDURATION$" -hds="$HOSTDURATIONSEC$" -hdt="$HOSTDOWNTIME$" -hpc="$HOSTPERCENTCHANGE$" -hgn="$HOSTGROUPNAME$" -hgns="$HOSTGROUPNAMES$" -lhc="$LASTHOSTCHECK$" -lhsc="$LASTHOSTSTATECHANGE$" -lhu="$LASTHOSTUP$" -lhd="$LASTHOSTDOWN$" -lhur="$LASTHOSTUNREACHABLE$" -ho="$HOSTOUTPUT$" -lho="$LONGHOSTOUTPUT$" -hpd="$HOSTPERFDATA$" -s="$SERVICEDESC$" -sdn="$SERVICEDISPLAYNAME$" -ss="$SERVICESTATE$" -ssi="$SERVICESTATEID$" -lss="$LASTSERVICESTATE$" -lssi="$LASTSERVICESTATEID$" -sst="$SERVICESTATETYPE$" -sa="$SERVICEATTEMPT$" -msa="$MAXSERVICEATTEMPTS$" -siv="$SERVICEISVOLATILE$" -sei="$SERVICEEVENTID$" -lsei="$LASTSERVICEEVENTID$" -spi="$SERVICEPROBLEMID$" -lspi="$LASTSERVICEPROBLEMID$" -sl="$SERVICELATENCY$" -set="$SERVICEEXECUTIONTIME$" -sd="$SERVICEDURATION$" -sds="$SERVICEDURATIONSEC$" -sdt="$SERVICEDOWNTIME$" -spc="$SERVICEPERCENTCHANGE$" -sgn="$SERVICEGROUPNAME$" -sgns="$SERVICEGROUPNAMES$" -lsch="$LASTSERVICECHECK$" -lssc="$LASTSERVICESTATECHANGE$" -lsok="$LASTSERVICEOK$" -lsw="$LASTSERVICEWARNING$" -lsu="$LASTSERVICEUNKNOWN$" -lsc="$LASTSERVICECRITICAL$" -so="$SERVICEOUTPUT$" -lso="$LONGSERVICEOUTPUT$" -spd="$SERVICEPERFDATA$" -snu="$SERVICENOTESURL$" 15 | } 16 | 17 | define command { 18 | command_name notify-host-by-jsm 19 | command_line /home/jsm/jec/scripts/send2jsm -entityType=host -t="$NOTIFICATIONTYPE$" -ldt="$LONGDATETIME$" -hn="$HOSTNAME$" -hdn="$HOSTDISPLAYNAME$" -hal="$HOSTALIAS$" -haddr="$HOSTADDRESS$" -hs="$HOSTSTATE$" -hsi="$HOSTSTATEID$" -lhs="$LASTHOSTSTATE$" -lhsi="$LASTHOSTSTATEID$" -hst="$HOSTSTATETYPE$" -ha="$HOSTATTEMPT$" -mha="$MAXHOSTATTEMPTS$" -hei="$HOSTEVENTID$" -lhei="$LASTHOSTEVENTID$" -hpi="$HOSTPROBLEMID$" -lhpi="$LASTHOSTPROBLEMID$" -hl="$HOSTLATENCY$" -het="$HOSTEXECUTIONTIME$" -hd="$HOSTDURATION$" -hds="$HOSTDURATIONSEC$" -hdt="$HOSTDOWNTIME$" -hpc="$HOSTPERCENTCHANGE$" -hgn="$HOSTGROUPNAME$" -hgns="$HOSTGROUPNAMES$" -lhc="$LASTHOSTCHECK$" -lhsc="$LASTHOSTSTATECHANGE$" -lhu="$LASTHOSTUP$" -lhd="$LASTHOSTDOWN$" -lhur="$LASTHOSTUNREACHABLE$" -ho="$HOSTOUTPUT$" -lho="$LONGHOSTOUTPUT$" -hpd="$HOSTPERFDATA$" -hnu="$HOSTNOTESURL$" 20 | } 21 | -------------------------------------------------------------------------------- /op5/conf/jsm.cfg: -------------------------------------------------------------------------------- 1 | define contact { 2 | contact_name jsm 3 | alias JSM Contact 4 | service_notification_period 24x7 5 | host_notification_period 24x7 6 | service_notification_options c,r 7 | host_notification_options d,r 8 | service_notification_commands notify-service-by-jsm 9 | host_notification_commands notify-host-by-jsm 10 | } 11 | 12 | define command { 13 | command_name notify-service-by-jsm 14 | command_line /home/jsm/jec/scripts/send2jsm -entityType=service -t="$NOTIFICATIONTYPE$" -ldt="$LONGDATETIME$" -hn="$HOSTNAME$" -hdn="$HOSTDISPLAYNAME$" -hal="$HOSTALIAS$" -haddr="$HOSTADDRESS$" -hs="$HOSTSTATE$" -hsi="$HOSTSTATEID$" -lhs="$LASTHOSTSTATE$" -lhsi="$LASTHOSTSTATEID$" -hst="$HOSTSTATETYPE$" -ha="$HOSTATTEMPT$" -mha="$MAXHOSTATTEMPTS$" -hei="$HOSTEVENTID$" -lhei="$LASTHOSTEVENTID$" -hpi="$HOSTPROBLEMID$" -lhpi="$LASTHOSTPROBLEMID$" -hl="$HOSTLATENCY$" -het="$HOSTEXECUTIONTIME$" -hd="$HOSTDURATION$" -hds="$HOSTDURATIONSEC$" -hdt="$HOSTDOWNTIME$" -hpc="$HOSTPERCENTCHANGE$" -hgn="$HOSTGROUPNAME$" -hgns="$HOSTGROUPNAMES$" -lhc="$LASTHOSTCHECK$" -lhsc="$LASTHOSTSTATECHANGE$" -lhu="$LASTHOSTUP$" -lhd="$LASTHOSTDOWN$" -lhur="$LASTHOSTUNREACHABLE$" -ho="$HOSTOUTPUT$" -lho="$LONGHOSTOUTPUT$" -hpd="$HOSTPERFDATA$" -s="$SERVICEDESC$" -sdn="$SERVICEDISPLAYNAME$" -ss="$SERVICESTATE$" -ssi="$SERVICESTATEID$" -lss="$LASTSERVICESTATE$" -lssi="$LASTSERVICESTATEID$" -sst="$SERVICESTATETYPE$" -sa="$SERVICEATTEMPT$" -msa="$MAXSERVICEATTEMPTS$" -siv="$SERVICEISVOLATILE$" -sei="$SERVICEEVENTID$" -lsei="$LASTSERVICEEVENTID$" -spi="$SERVICEPROBLEMID$" -lspi="$LASTSERVICEPROBLEMID$" -sl="$SERVICELATENCY$" -set="$SERVICEEXECUTIONTIME$" -sd="$SERVICEDURATION$" -sds="$SERVICEDURATIONSEC$" -sdt="$SERVICEDOWNTIME$" -spc="$SERVICEPERCENTCHANGE$" -sgn="$SERVICEGROUPNAME$" -sgns="$SERVICEGROUPNAMES$" -lsch="$LASTSERVICECHECK$" -lssc="$LASTSERVICESTATECHANGE$" -lsok="$LASTSERVICEOK$" -lsw="$LASTSERVICEWARNING$" -lsu="$LASTSERVICEUNKNOWN$" -lsc="$LASTSERVICECRITICAL$" -so="$SERVICEOUTPUT$" -lso="$LONGSERVICEOUTPUT$" -spd="$SERVICEPERFDATA$" -snu="$SERVICENOTESURL$" 15 | } 16 | 17 | define command { 18 | command_name notify-host-by-jsm 19 | command_line /home/jsm/jec/scripts/send2jsm -entityType=host -t="$NOTIFICATIONTYPE$" -ldt="$LONGDATETIME$" -hn="$HOSTNAME$" -hdn="$HOSTDISPLAYNAME$" -hal="$HOSTALIAS$" -haddr="$HOSTADDRESS$" -hs="$HOSTSTATE$" -hsi="$HOSTSTATEID$" -lhs="$LASTHOSTSTATE$" -lhsi="$LASTHOSTSTATEID$" -hst="$HOSTSTATETYPE$" -ha="$HOSTATTEMPT$" -mha="$MAXHOSTATTEMPTS$" -hei="$HOSTEVENTID$" -lhei="$LASTHOSTEVENTID$" -hpi="$HOSTPROBLEMID$" -lhpi="$LASTHOSTPROBLEMID$" -hl="$HOSTLATENCY$" -het="$HOSTEXECUTIONTIME$" -hd="$HOSTDURATION$" -hds="$HOSTDURATIONSEC$" -hdt="$HOSTDOWNTIME$" -hpc="$HOSTPERCENTCHANGE$" -hgn="$HOSTGROUPNAME$" -hgns="$HOSTGROUPNAMES$" -lhc="$LASTHOSTCHECK$" -lhsc="$LASTHOSTSTATECHANGE$" -lhu="$LASTHOSTUP$" -lhd="$LASTHOSTDOWN$" -lhur="$LASTHOSTUNREACHABLE$" -ho="$HOSTOUTPUT$" -lho="$LONGHOSTOUTPUT$" -hpd="$HOSTPERFDATA$" -hnu="$HOSTNOTESURL$" 20 | } 21 | -------------------------------------------------------------------------------- /signal-sciences/scripts/lambda.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | import requests 4 | 5 | ############ Jira Service Management Configuration ############## 6 | jsmAPIKey = "" 7 | jsmAPIURL = "https://api.atlassian.com" 8 | jsmAlertEndPoint = "/jsm/ops/integration/v1/json/alert" 9 | SIGSCI_EMAIL = "" 10 | SIGSCI_PASSWORD = "" 11 | corpName = "" 12 | siteName = "" 13 | endpoint = 'https://dashboard.signalsciences.net/api/v0' 14 | jsmAlertAddNoteEndPoint = jsmAlertEndPoint + "/note" 15 | 16 | 17 | def lambda_handler(event, context): 18 | def getAlert(alertId): 19 | params = { 20 | "apiKey": jsmAPIKey, 21 | "id": alertId 22 | } 23 | 24 | req = requests.get(jsmAPIURL + jsmAlertEndPoint, params=params) 25 | alert = req.json() 26 | 27 | return alert 28 | 29 | def getAlertDetails(alertId): 30 | alert = getAlert(alertId) 31 | 32 | details = alert["details"] 33 | return details 34 | 35 | # Authenticate 36 | 37 | auth = requests.post( 38 | endpoint + '/auth/login', 39 | data={"email": SIGSCI_EMAIL, "password": SIGSCI_PASSWORD}, 40 | allow_redirects=False 41 | ) 42 | 43 | def addNoteToTheRootAlert(responseData): 44 | reqData = { 45 | "apiKey": jsmAPIKey, 46 | "id": event["alert"]["alertId"], 47 | "note": responseData 48 | } 49 | 50 | req = requests.post(jsmAPIURL + jsmAlertAddNoteEndPoint, json=reqData) 51 | 52 | result = req.json() 53 | print str(result) 54 | 55 | cookies = auth.cookies 56 | location = auth.headers['Location'] 57 | 58 | if location == '/': 59 | print 'Successfully authenticated to SignalSciences.' 60 | elif location == '/login?p=invalid': 61 | print 'Invalid login.' 62 | return {"Error": "Invalid Login."} 63 | else: 64 | print 'Unexpected error (location = {0})'.format(location) 65 | return {"Error": "Unexpected error (location = {0})".format(location)} 66 | 67 | # Get IP address to block 68 | alertDetails = getAlertDetails(event["alert"]["alertId"]) 69 | 70 | # Prepare body to send the IP to add blockList 71 | body = { 72 | "source": alertDetails["ip"], 73 | "note": alertDetails["ip"] + " added to blackList." 74 | } 75 | print "PUT request is sending to " + endpoint + "/corps/" + corpName + "/sites/" + siteName + "/blacklist" 76 | print "Body to be sent: " + json.dumps(body) 77 | # Add to blockList 78 | headers = {'Content-type': 'application/json'} 79 | putData = requests.put(endpoint + '/corps/' + corpName + '/sites/' + siteName + '/blacklist', cookies=cookies, 80 | data=json.dumps(body), 81 | headers=headers) 82 | 83 | print "Status" + str(putData) 84 | print "Response Content: " + str(putData.json()) 85 | resDataJson = putData.json() 86 | note = resDataJson["note"] 87 | addNoteToTheRootAlert(note) 88 | return {"Success": "Script completed successfully."} 89 | -------------------------------------------------------------------------------- /release/integration-builder/vcsa/vcsa.gradle: -------------------------------------------------------------------------------- 1 | task prepareVCSA() << { 2 | def destination = "${project.buildDir}/vcsa" 3 | copy { 4 | from "${project.buildDir}/jsm-integration" 5 | into "${destination}/jsm-integration" 6 | } 7 | 8 | copy { 9 | from "${project.projectDir}/vcsa/scripts/send2jsm.go" 10 | into "${destination}/vcsa" 11 | } 12 | 13 | copy { 14 | from "${project.projectDir}/vcsa/scripts/send2jsm" 15 | into "${destination}/vcsa" 16 | } 17 | 18 | copy { 19 | from "${project.projectDir}/vcsa/conf/integration.conf" 20 | into "${destination}/jsm-integration/conf" 21 | } 22 | } 23 | 24 | def buildRpmForVCSA(String sourceDir, String name, String descrpt, Map fileMappingInput, Map configFilesInput) { 25 | def taskName = "generateRpm${sourceDir}" 26 | 27 | def configFiles = [:] 28 | configFiles.putAll(configFilesInput) 29 | def fileMapping = [:] 30 | fileMapping.putAll(fileMappingInput) 31 | 32 | task "${taskName}"(type: Rpm) { 33 | def packageVersion = project.ext.versions.vcsa + project.ext.versionSuffix 34 | 35 | packageName = name 36 | description = descrpt 37 | summary = descrpt 38 | packageDescription = descrpt + ". Please see doc for details: https://www.atlassian.com/docs/" 39 | version = packageVersion.replace("-", "."); 40 | os = LINUX 41 | user = 'root' 42 | 43 | release = '1.all' 44 | packager = "ifountain" 45 | vendor = "Atlassian" 46 | url = "https://www.atlassian.com" 47 | license = "Apache License 2.0" 48 | buildHost = "repo.atlassian.com" 49 | packageGroup = "System Administration Tools" 50 | 51 | 52 | configFiles.put("${project.buildDir}/${sourceDir}/jsm-integration/conf/integration.conf", 'etc/jsm/conf') 53 | 54 | for (def source : configFiles.keySet()) { 55 | def dest = configFiles.get(source) 56 | logger.info("config " + source + " - " + dest) 57 | from(source) { 58 | fileType CONFIG | NOREPLACE 59 | into(dest) 60 | } 61 | } 62 | 63 | for(def source : fileMapping.keySet()) { 64 | def dest = fileMapping.get(source) 65 | logger.info(source + " - " + dest) 66 | from(source) { 67 | into(dest) 68 | } 69 | } 70 | 71 | preInstall file("${project.projectDir}/vcsa/native/ogBefore.sh") 72 | postInstall file("${project.projectDir}/vcsa/native/ogAfter.sh") 73 | } 74 | 75 | tasks[taskName].execute() 76 | } 77 | 78 | task packageVCSAOS(dependsOn: 'prepareVCSA') << { 79 | 80 | def fileMapping = [ 81 | "${project.projectDir}/vcsa/scripts/send2jsm" : "etc/jsm", 82 | "${project.projectDir}/vcsa/scripts/send2jsm.go": "etc/jsm" 83 | ] 84 | 85 | buildRpmForVCSA('vcsa', 'jsm-vcsa', 'JSM - VCSA integration files', 86 | fileMapping, [:]) 87 | 88 | } 89 | 90 | task vcsa(dependsOn: 'packageVCSAOS') 91 | -------------------------------------------------------------------------------- /zendesk/conf/triggerInstructions.md: -------------------------------------------------------------------------------- 1 | ## Zendesk to JSM Trigger Setting 2 | ### Create Action: 3 | - From the **Triggers** page, click **Create trigger**. 4 | - Put **Send Create action to JSM** into **Trigger name**, description is optional. 5 | - Under **Meet ALL the following conditions:**, add two conditions as specified below: 6 | - Status Is not Solved 7 | - Ticket Is Created 8 | - Under **Actions**, select **Notify by** and **Active webhook**, and pick the webhook you added earlier for the integration. 9 | - Paste the following into the **JSON body** field: 10 | ``` 11 | { 12 | "action": "create", 13 | "ticketId": "{{ticket.id}}", 14 | "status": "{{ticket.status}}", 15 | "via": "{{ticket.via}}", 16 | "title": "{{ticket.title}}", 17 | "external_id": "{{ticket.external_id}}", 18 | "link": "{{ticket.link}}", 19 | "priority": "{{ticket.priority}}", 20 | "due_date": "{{ticket.due_date}}", 21 | "ticket_type": "{{ticket.ticket_type}}", 22 | "assignee_name": "{{ticket.assignee.name}}", 23 | "organization_name": "{{ticket.organization.name}}", 24 | "group_name": "{{ticket.group.name}}", 25 | "account": "{{ticket.account}}", 26 | "requester_name": "{{ticket.requester.name}}", 27 | "description": "{{ticket.description}}", 28 | "latest_comment": "{{ticket.latest_comment_html}}", 29 | "tags": "{{ticket.tags}}" 30 | } 31 | ``` 32 | 33 | ### Resolved Action: 34 | - From the **Triggers** page, click **Create trigger**. 35 | - Put **Send Resolved action to JSM** into **Trigger name**, description is optional. 36 | - Under **Meet ALL the following condition:**, add a condition as specified below: 37 | - Ticket:Status Is Solved 38 | - Under **Actions**, select **Notify by** and **Active webhook**, and pick the webhook you added earlier for the integration. 39 | - Paste the following into the **JSON body** field: 40 | ``` 41 | { 42 | "action": "close", 43 | "ticketId": "{{ticket.id}}", 44 | "status": "{{ticket.status}}", 45 | "latest_comment": "{{ticket.latest_comment_html}}", 46 | "tags": "{{ticket.tags}}", 47 | "external_id": "{{ticket.external_id}}", 48 | "current_user_name": "{{current_user.name}}" 49 | } 50 | ``` 51 | 52 | ### Add Note Action: 53 | - From the **Triggers** page, click **Create trigger**. 54 | - Put **Send Add Note action to JSM** into **Trigger name**, description is optional. 55 | - Under **Meet ALL the following conditions:**, add two conditions as specified below: 56 | - Ticket: Is Updated 57 | - Ticket:Status Is Not Solved 58 | - Ticket:Comment Is Public 59 | - Under **Actions**, select **Notify by** and **Active webhook**, and pick the webhook you added earlier for the integration. 60 | - Paste the following into the **JSON body** field: 61 | ``` 62 | { 63 | "action": "addnote", 64 | "ticketId": "{{ticket.id}}", 65 | "status": "{{ticket.status}}", 66 | "latest_comment": "{{ticket.latest_comment_html}}", 67 | "tags": "{{ticket.tags}}", 68 | "external_id": "{{ticket.external_id}}", 69 | "current_user_name": "{{current_user.name}}" 70 | } 71 | ``` 72 | -------------------------------------------------------------------------------- /.github/workflows/release-without-jec-all.yml: -------------------------------------------------------------------------------- 1 | name: Release All Integrations without JEC scripts 2 | on: 3 | workflow_dispatch: 4 | 5 | jobs: 6 | setup: 7 | runs-on: ubuntu-latest 8 | outputs: 9 | integrations: ${{ steps.gather_params.outputs.INTEGRATIONS }} 10 | steps: 11 | - name: Check out code into the Go module directory 12 | uses: actions/checkout@v4 13 | - name: Retrieve Integration Version 14 | id: gather_params 15 | run: | 16 | echo ::set-output name=INTEGRATIONS::$(jq -r 'keys' release/integration-builder/version.json) 17 | release-integrations: 18 | needs: [ setup ] 19 | strategy: 20 | matrix: 21 | integration: ${{ fromJson(needs.setup.outputs.integrations) }} 22 | uses: ./.github/workflows/release-without-jec.yml 23 | with: 24 | integration: ${{ matrix.integration }} 25 | update-versions: 26 | name: Update versions 27 | runs-on: ubuntu-latest 28 | needs: [ setup ] 29 | if: github.ref == 'refs/heads/master' 30 | steps: 31 | - name: Checkout the repository with branch 32 | uses: actions/checkout@v4 33 | - name: Set branch name to env 34 | id: prepare-branch-name 35 | run: | 36 | branchName=release-all-non-jec-$(date +%s) 37 | echo branchName:$branchName 38 | echo ::set-output name=BRANCH_NAME::$(echo $branchName) 39 | - name: Commit and push changes 40 | env: 41 | GH_TOKEN: ${{ github.token }} 42 | BRANCH_NAME: ${{ steps.prepare-branch-name.outputs.branch_name }} 43 | run: | 44 | BRANCH_NAME=${{ env.BRANCH_NAME }} 45 | version_file="release/integration-builder/version.json" 46 | 47 | git config --global user.name 'Github Actions' 48 | git config --global user.email 'support@atlassian.com' 49 | git checkout "$BRANCH_NAME" 2>/dev/null || git checkout -b "$BRANCH_NAME" 50 | 51 | pr_body=$'Update all non-jec integrations\' versions\n' 52 | 53 | inc_ver() { 54 | local INTEGRATION_NAME=$1 55 | current_version=$(jq -r --arg integration "$INTEGRATION_NAME" '.[$integration]' "$version_file") 56 | new_version=$(echo "$current_version" | awk -F. -v OFS=. '{$3++;print}') 57 | echo "Updating $INTEGRATION_NAME version from $current_version to $new_version in $version_file" 58 | jq --arg new_version "$new_version" --arg integration "$INTEGRATION_NAME" '.[$integration] = $new_version' "$version_file" >temp.json && mv temp.json "$version_file" 59 | pr_body+=$'\n- Update '$INTEGRATION_NAME$' version from '$current_version$' to '$new_version 60 | } 61 | 62 | while read -r key; do 63 | inc_ver "$key" 64 | done < <(jq -r 'keys' "$version_file" | jq -r '.[]') 65 | 66 | git commit -am "Update version file after release(s)" 67 | git push origin "$BRANCH_NAME" 68 | gh pr create --title "Update all non-jec integrations' versions" \ 69 | --body "$pr_body" \ 70 | --base master \ 71 | --head $BRANCH_NAME \ 72 | --reviewer ${{ github.actor }} 73 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/urllib3/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | urllib3 - Thread-safe connection pooling and re-using. 3 | """ 4 | 5 | from __future__ import absolute_import 6 | import warnings 7 | 8 | from .connectionpool import ( 9 | HTTPConnectionPool, 10 | HTTPSConnectionPool, 11 | connection_from_url 12 | ) 13 | 14 | from . import exceptions 15 | from .filepost import encode_multipart_formdata 16 | from .poolmanager import PoolManager, ProxyManager, proxy_from_url 17 | from .response import HTTPResponse 18 | from .util.request import make_headers 19 | from .util.url import get_host 20 | from .util.timeout import Timeout 21 | from .util.retry import Retry 22 | 23 | 24 | # Set default logging handler to avoid "No handler found" warnings. 25 | import logging 26 | try: # Python 2.7+ 27 | from logging import NullHandler 28 | except ImportError: 29 | class NullHandler(logging.Handler): 30 | def emit(self, record): 31 | pass 32 | 33 | __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)' 34 | __license__ = 'MIT' 35 | __version__ = '1.16' 36 | 37 | __all__ = ( 38 | 'HTTPConnectionPool', 39 | 'HTTPSConnectionPool', 40 | 'PoolManager', 41 | 'ProxyManager', 42 | 'HTTPResponse', 43 | 'Retry', 44 | 'Timeout', 45 | 'add_stderr_logger', 46 | 'connection_from_url', 47 | 'disable_warnings', 48 | 'encode_multipart_formdata', 49 | 'get_host', 50 | 'make_headers', 51 | 'proxy_from_url', 52 | ) 53 | 54 | logging.getLogger(__name__).addHandler(NullHandler()) 55 | 56 | 57 | def add_stderr_logger(level=logging.DEBUG): 58 | """ 59 | Helper for quickly adding a StreamHandler to the logger. Useful for 60 | debugging. 61 | 62 | Returns the handler after adding it. 63 | """ 64 | # This method needs to be in this __init__.py to get the __name__ correct 65 | # even if urllib3 is vendored within another package. 66 | logger = logging.getLogger(__name__) 67 | handler = logging.StreamHandler() 68 | handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s')) 69 | logger.addHandler(handler) 70 | logger.setLevel(level) 71 | logger.debug('Added a stderr logging handler to logger: %s', __name__) 72 | return handler 73 | 74 | # ... Clean up. 75 | del NullHandler 76 | 77 | 78 | # All warning filters *must* be appended unless you're really certain that they 79 | # shouldn't be: otherwise, it's very hard for users to use most Python 80 | # mechanisms to silence them. 81 | # SecurityWarning's always go off by default. 82 | warnings.simplefilter('always', exceptions.SecurityWarning, append=True) 83 | # SubjectAltNameWarning's should go off once per host 84 | warnings.simplefilter('default', exceptions.SubjectAltNameWarning, append=True) 85 | # InsecurePlatformWarning's don't vary between requests, so we keep it default. 86 | warnings.simplefilter('default', exceptions.InsecurePlatformWarning, 87 | append=True) 88 | # SNIMissingWarnings should go off only once. 89 | warnings.simplefilter('default', exceptions.SNIMissingWarning, append=True) 90 | 91 | 92 | def disable_warnings(category=exceptions.HTTPWarning): 93 | """ 94 | Helper for quickly disabling all urllib3 warnings. 95 | """ 96 | warnings.simplefilter('ignore', category) 97 | -------------------------------------------------------------------------------- /.github/workflows/release-with-jec-all.yml: -------------------------------------------------------------------------------- 1 | name: Release All Integrations with JEC scripts 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | jec-version: 6 | description: 'Version of JEC' 7 | required: true 8 | 9 | jobs: 10 | setup: 11 | runs-on: ubuntu-latest 12 | outputs: 13 | integrations: ${{ steps.gather_params.outputs.INTEGRATIONS }} 14 | steps: 15 | - name: Check out code into the Go module directory 16 | uses: actions/checkout@v4 17 | - name: Retrieve Integration Version 18 | id: gather_params 19 | run: | 20 | echo ::set-output name=INTEGRATIONS::$(jq 'del(.jecVersion)' release/jec-builder/version.json | jq -r 'keys') 21 | release-integrations: 22 | needs: [ setup ] 23 | strategy: 24 | matrix: 25 | integration: ${{ fromJson(needs.setup.outputs.integrations) }} 26 | uses: ./.github/workflows/release-with-jec.yml 27 | with: 28 | integration: ${{ matrix.integration }} 29 | jec-version: ${{ github.event.inputs.jec-version }} 30 | update-versions: 31 | name: Update versions 32 | runs-on: ubuntu-latest 33 | needs: [ setup ] 34 | if: github.ref == 'refs/heads/master' 35 | steps: 36 | - name: Checkout the repository with branch 37 | uses: actions/checkout@v4 38 | - name: Set branch name to env 39 | id: prepare-branch-name 40 | run: | 41 | branchName=release-all-jec-$(date +%s) 42 | echo branchName:$branchName 43 | echo ::set-output name=BRANCH_NAME::$(echo $branchName) 44 | - name: Commit and push changes 45 | env: 46 | GH_TOKEN: ${{ github.token }} 47 | BRANCH_NAME: ${{ steps.prepare-branch-name.outputs.branch_name }} 48 | run: | 49 | BRANCH_NAME=${{ env.BRANCH_NAME }} 50 | version_file="release/jec-builder/version.json" 51 | 52 | git config --global user.name 'Github Actions' 53 | git config --global user.email 'support@atlassian.com' 54 | git checkout "$BRANCH_NAME" 2>/dev/null || git checkout -b "$BRANCH_NAME" 55 | 56 | pr_body=$'Update all jec integrations\' versions\n' 57 | 58 | inc_ver() { 59 | local INTEGRATION_NAME=$1 60 | current_version=$(jq -r --arg integration "$INTEGRATION_NAME" '.[$integration]' "$version_file") 61 | new_version=$(echo "$current_version" | awk -F. -v OFS=. '{$3++;print}') 62 | echo "Updating $INTEGRATION_NAME version from $current_version to $new_version in $version_file" 63 | jq --arg new_version "$new_version" --arg integration "$INTEGRATION_NAME" '.[$integration] = $new_version' "$version_file" >temp.json && mv temp.json "$version_file" 64 | pr_body+=$'\n- Update '$INTEGRATION_NAME$' version from '$current_version$' to '$new_version 65 | } 66 | 67 | while read -r key; do 68 | inc_ver "$key" 69 | done < <(jq 'del(.jecVersion)' "$version_file" | jq -r 'keys' | jq -r '.[]') 70 | 71 | git commit -am "Update version file after release(s)" 72 | git push origin "$BRANCH_NAME" 73 | gh pr create --title "Update all jec integrations' versions" \ 74 | --body "$pr_body" \ 75 | --base master \ 76 | --head $BRANCH_NAME \ 77 | --reviewer ${{ github.actor }} 78 | -------------------------------------------------------------------------------- /prtg/scripts/jec_action_executor.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import json 3 | import logging 4 | import sys 5 | 6 | import requests 7 | 8 | parser = argparse.ArgumentParser() 9 | parser.add_argument('-payload', '--queuePayload', help='Payload from queue', required=True) 10 | parser.add_argument('-apiKey', '--apiKey', help='The apiKey of the integration', required=True) 11 | parser.add_argument('-jsmUrl', '--jsmUrl', help='The url', required=True) 12 | parser.add_argument('-logLevel', '--logLevel', help='Level of log', required=True) 13 | parser.add_argument('-username', '--username', help='Username', required=False) 14 | parser.add_argument('-passhash', '--passhash', help='Passhash', required=False) 15 | parser.add_argument('-prtgUrl', '--prtgUrl', help='PRTG Url', required=False) 16 | parser.add_argument('-sensorId', '--sensorId', help='Sensor Id', required=False) 17 | parser.add_argument('-acknowledgeMessage', '--acknowledgeMessage', help='Acknowledge Message', required=False) 18 | args, unknown = parser.parse_known_args() 19 | args = vars(args) 20 | 21 | logging.basicConfig(stream=sys.stdout, level=args['logLevel']) 22 | 23 | 24 | def parse_field(key, mandatory): 25 | variable = queue_message.get(key) 26 | if not variable: 27 | variable = args.get(key) 28 | if mandatory and not variable: 29 | logging.error(LOG_PREFIX + " Skipping action, Mandatory conf item '" + key + 30 | "' is missing. Check your configuration file.") 31 | raise ValueError(LOG_PREFIX + " Skipping action, Mandatory conf item '" + key + 32 | "' is missing. Check your configuration file.") 33 | return variable 34 | 35 | 36 | def parse_timeout(): 37 | parsed_timeout = args.get('http.timeout') 38 | if not parsed_timeout: 39 | return 30000 40 | return int(parsed_timeout) 41 | 42 | 43 | def main(): 44 | global LOG_PREFIX 45 | global queue_message 46 | global timeout 47 | 48 | queue_message_string = args['queuePayload'] 49 | queue_message_string = queue_message_string.strip() 50 | queue_message = json.loads(queue_message_string) 51 | 52 | alert_id = queue_message["alertId"] 53 | mapped_action = queue_message["mappedActionV2"]["name"] 54 | 55 | LOG_PREFIX = "[" + mapped_action + "]" 56 | 57 | logging.info("Will execute " + mapped_action + " for alertId " + alert_id) 58 | 59 | timeout = parse_timeout() 60 | url = parse_field('prtgUrl', True) 61 | username = parse_field('username', True) 62 | passhash = parse_field('passhash', True) 63 | ackMessage = parse_field('acknowledgeMessage', True) 64 | id = parse_field('sensorId', True) 65 | 66 | prtgPath = "/api/acknowledgealarm.htm" 67 | if url.endswith("/"): 68 | prtgPath = "api/acknowledgealarm.htm" 69 | 70 | result_url = url + prtgPath 71 | 72 | params = { 73 | 'id': id, 74 | 'ackmsg': ackMessage, 75 | 'username': username, 76 | 'passhash': passhash 77 | } 78 | logging.debug("Sending request to PRTG.") 79 | response = requests.post(result_url, params=params, timeout=timeout) 80 | if response.status_code < 300: 81 | logging.info("Successfully executed at PRTG") 82 | 83 | else: 84 | logging.warning( 85 | LOG_PREFIX + " Could not execute at PRTG; response: " + str(response.content) + " status code: " + str( 86 | response.status_code)) 87 | 88 | 89 | if __name__ == '__main__': 90 | main() 91 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/exceptions.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests.exceptions 5 | ~~~~~~~~~~~~~~~~~~~ 6 | 7 | This module contains the set of Requests' exceptions. 8 | """ 9 | from .packages.urllib3.exceptions import HTTPError as BaseHTTPError 10 | 11 | 12 | class RequestException(IOError): 13 | """There was an ambiguous exception that occurred while handling your 14 | request. 15 | """ 16 | 17 | def __init__(self, *args, **kwargs): 18 | """Initialize RequestException with `request` and `response` objects.""" 19 | response = kwargs.pop('response', None) 20 | self.response = response 21 | self.request = kwargs.pop('request', None) 22 | if (response is not None and not self.request and 23 | hasattr(response, 'request')): 24 | self.request = self.response.request 25 | super(RequestException, self).__init__(*args, **kwargs) 26 | 27 | 28 | class HTTPError(RequestException): 29 | """An HTTP error occurred.""" 30 | 31 | 32 | class ConnectionError(RequestException): 33 | """A Connection error occurred.""" 34 | 35 | 36 | class ProxyError(ConnectionError): 37 | """A proxy error occurred.""" 38 | 39 | 40 | class SSLError(ConnectionError): 41 | """An SSL error occurred.""" 42 | 43 | 44 | class Timeout(RequestException): 45 | """The request timed out. 46 | 47 | Catching this error will catch both 48 | :exc:`~requests.exceptions.ConnectTimeout` and 49 | :exc:`~requests.exceptions.ReadTimeout` errors. 50 | """ 51 | 52 | 53 | class ConnectTimeout(ConnectionError, Timeout): 54 | """The request timed out while trying to connect to the remote server. 55 | 56 | Requests that produced this error are safe to retry. 57 | """ 58 | 59 | 60 | class ReadTimeout(Timeout): 61 | """The server did not send any data in the allotted amount of time.""" 62 | 63 | 64 | class URLRequired(RequestException): 65 | """A valid URL is required to make a request.""" 66 | 67 | 68 | class TooManyRedirects(RequestException): 69 | """Too many redirects.""" 70 | 71 | 72 | class MissingSchema(RequestException, ValueError): 73 | """The URL schema (e.g. http or https) is missing.""" 74 | 75 | 76 | class InvalidSchema(RequestException, ValueError): 77 | """See defaults.py for valid schemas.""" 78 | 79 | 80 | class InvalidURL(RequestException, ValueError): 81 | """The URL provided was somehow invalid.""" 82 | 83 | 84 | class InvalidHeader(RequestException, ValueError): 85 | """The header value provided was somehow invalid.""" 86 | 87 | 88 | class ChunkedEncodingError(RequestException): 89 | """The server declared chunked encoding but sent an invalid chunk.""" 90 | 91 | 92 | class ContentDecodingError(RequestException, BaseHTTPError): 93 | """Failed to decode response content""" 94 | 95 | 96 | class StreamConsumedError(RequestException, TypeError): 97 | """The content for this response was already consumed""" 98 | 99 | 100 | class RetryError(RequestException): 101 | """Custom retries logic failed""" 102 | 103 | 104 | # Warnings 105 | 106 | 107 | class RequestsWarning(Warning): 108 | """Base warning for Requests.""" 109 | pass 110 | 111 | 112 | class FileModeWarning(RequestsWarning, DeprecationWarning): 113 | """A file was opened in text mode, but Requests determined its binary length.""" 114 | pass 115 | -------------------------------------------------------------------------------- /icinga2/conf/jsm.conf: -------------------------------------------------------------------------------- 1 | object NotificationCommand "jsm-service-notification" { 2 | import "plugin-notification-command" 3 | 4 | vars.hgns = {{ host.groups.join(",") }} 5 | vars.sgns = {{ service.groups.join(",") }} 6 | command = [ "/home/jsm/jec/scripts/send2jsm" ] 7 | arguments = { 8 | "-entityType" = "service" 9 | "-t" = "$notification.type$" 10 | "-ldt" = "$icinga.long_date_time$" 11 | "-hn" = "$host.name$" 12 | "-hdn" = "$host.display_name$" 13 | "-hal" = "$host.display_name$" 14 | "-haddr" = "$host.address$" 15 | "-hs" = "$host.state$" 16 | "-hsi" = "$host.state_id$" 17 | "-lhs" = "$host.last_state$" 18 | "-lhsi" = "$host.last_state_id$" 19 | "-hst" = "$host.state_type$" 20 | "-ha" = "$host.check_attempt$" 21 | "-mha" = "$host.max_check_attempts$" 22 | "-hl" = "$host.latency$" 23 | "-het" = "$host.execution_time$" 24 | "-hds" = "$host.duration_sec$" 25 | "-hdt" = "$host.downtime_depth$" 26 | "-hgn" = "$host.group$" 27 | "-hgns" = "$command.vars.hgns$" 28 | "-lhc" = "$host.last_check$" 29 | "-lhsc" = "$host.last_state_change$" 30 | "-ho" = "$host.output$" 31 | "-hpd" = "$host.perfdata$" 32 | "-s" = "$service.name$" 33 | "-sdn" = "$service.display_name$" 34 | "-ss" = "$service.state$" 35 | "-ssi" = "$service.state_id$" 36 | "-lss" = "$service.last_state$" 37 | "-lssi" = "$service.last_state_id$" 38 | "-sst" = "$service.state_type$" 39 | "-sa" = "$service.check_attempt$" 40 | "-sc" = "$service.check_command$" 41 | "-msa" = "$service.max_check_attempts$" 42 | "-sl" = "$service.latency$" 43 | "-set" = "$service.execution_time$" 44 | "-sds" = "$service.duration_sec$" 45 | "-sdt" = "$service.downtime_depth$" 46 | "-sgns" = "$command.vars.sgns$" 47 | "-lsch" = "$service.last_check$" 48 | "-lssc" = "$service.last_state_change$" 49 | "-so" = "$service.output$" 50 | "-spd" = "$service.perfdata$" 51 | } 52 | } 53 | 54 | object NotificationCommand "jsm-host-notification" { 55 | import "plugin-notification-command" 56 | 57 | vars.hgns = {{ host.groups.join(",") }} 58 | command = [ "/home/jsm/jec/scripts/send2jsm" ] 59 | arguments = { 60 | "-entityType" = "host" 61 | "-t" = "$notification.type$" 62 | "-ldt" = "$icinga.long_date_time$" 63 | "-hn" = "$host.name$" 64 | "-hdn" = "$host.display_name$" 65 | "-hal" = "$host.display_name$" 66 | "-haddr" = "$host.address$" 67 | "-hs" = "$host.state$" 68 | "-hsi" = "$host.state_id$" 69 | "-lhs" = "$host.last_state$" 70 | "-lhsi" = "$host.last_state_id$" 71 | "-hst" = "$host.state_type$" 72 | "-ha" = "$host.check_attempt$" 73 | "-mha" = "$host.max_check_attempts$" 74 | "-hl" = "$host.latency$" 75 | "-het" = "$host.execution_time$" 76 | "-hds" = "$host.duration_sec$" 77 | "-hdt" = "$host.downtime_depth$" 78 | "-hgn" = "$host.group$" 79 | "-hgns" = "$command.vars.hgns$" 80 | "-lhc" = "$host.last_check$" 81 | "-lhsc" = "$host.last_state_change$" 82 | "-ho" = "$host.output$" 83 | "-hpd" = "$host.perfdata$" 84 | } 85 | } 86 | 87 | object User "jsm" { 88 | import "generic-user" 89 | display_name = "JSM Contact" 90 | } 91 | 92 | apply Notification "notify-jsm-service" to Service { 93 | command = "jsm-service-notification" 94 | users = ["jsm"] 95 | assign where service 96 | } 97 | 98 | apply Notification "notify-jsm-host" to Host { 99 | command = "jsm-host-notification" 100 | users = ["jsm"] 101 | assign where host 102 | } 103 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/chardet/escprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from . import constants 29 | from .escsm import (HZSMModel, ISO2022CNSMModel, ISO2022JPSMModel, 30 | ISO2022KRSMModel) 31 | from .charsetprober import CharSetProber 32 | from .codingstatemachine import CodingStateMachine 33 | from .compat import wrap_ord 34 | 35 | 36 | class EscCharSetProber(CharSetProber): 37 | def __init__(self): 38 | CharSetProber.__init__(self) 39 | self._mCodingSM = [ 40 | CodingStateMachine(HZSMModel), 41 | CodingStateMachine(ISO2022CNSMModel), 42 | CodingStateMachine(ISO2022JPSMModel), 43 | CodingStateMachine(ISO2022KRSMModel) 44 | ] 45 | self.reset() 46 | 47 | def reset(self): 48 | CharSetProber.reset(self) 49 | for codingSM in self._mCodingSM: 50 | if not codingSM: 51 | continue 52 | codingSM.active = True 53 | codingSM.reset() 54 | self._mActiveSM = len(self._mCodingSM) 55 | self._mDetectedCharset = None 56 | 57 | def get_charset_name(self): 58 | return self._mDetectedCharset 59 | 60 | def get_confidence(self): 61 | if self._mDetectedCharset: 62 | return 0.99 63 | else: 64 | return 0.00 65 | 66 | def feed(self, aBuf): 67 | for c in aBuf: 68 | # PY3K: aBuf is a byte array, so c is an int, not a byte 69 | for codingSM in self._mCodingSM: 70 | if not codingSM: 71 | continue 72 | if not codingSM.active: 73 | continue 74 | codingState = codingSM.next_state(wrap_ord(c)) 75 | if codingState == constants.eError: 76 | codingSM.active = False 77 | self._mActiveSM -= 1 78 | if self._mActiveSM <= 0: 79 | self._mState = constants.eNotMe 80 | return self.get_state() 81 | elif codingState == constants.eItsMe: 82 | self._mState = constants.eFoundIt 83 | self._mDetectedCharset = codingSM.get_coding_state_machine() # nopep8 84 | return self.get_state() 85 | 86 | return self.get_state() 87 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/structures.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests.structures 5 | ~~~~~~~~~~~~~~~~~~~ 6 | 7 | Data structures that power Requests. 8 | """ 9 | 10 | import collections 11 | 12 | from .compat import OrderedDict 13 | 14 | 15 | class CaseInsensitiveDict(collections.MutableMapping): 16 | """A case-insensitive ``dict``-like object. 17 | 18 | Implements all methods and operations of 19 | ``collections.MutableMapping`` as well as dict's ``copy``. Also 20 | provides ``lower_items``. 21 | 22 | All keys are expected to be strings. The structure remembers the 23 | case of the last key to be set, and ``iter(instance)``, 24 | ``keys()``, ``items()``, ``iterkeys()``, and ``iteritems()`` 25 | will contain case-sensitive keys. However, querying and contains 26 | testing is case insensitive:: 27 | 28 | cid = CaseInsensitiveDict() 29 | cid['Accept'] = 'application/json' 30 | cid['aCCEPT'] == 'application/json' # True 31 | list(cid) == ['Accept'] # True 32 | 33 | For example, ``headers['content-encoding']`` will return the 34 | value of a ``'Content-Encoding'`` response header, regardless 35 | of how the header name was originally stored. 36 | 37 | If the constructor, ``.update``, or equality comparison 38 | operations are given keys that have equal ``.lower()``s, the 39 | behavior is undefined. 40 | """ 41 | 42 | def __init__(self, data=None, **kwargs): 43 | self._store = OrderedDict() 44 | if data is None: 45 | data = {} 46 | self.update(data, **kwargs) 47 | 48 | def __setitem__(self, key, value): 49 | # Use the lowercased key for lookups, but store the actual 50 | # key alongside the value. 51 | self._store[key.lower()] = (key, value) 52 | 53 | def __getitem__(self, key): 54 | return self._store[key.lower()][1] 55 | 56 | def __delitem__(self, key): 57 | del self._store[key.lower()] 58 | 59 | def __iter__(self): 60 | return (casedkey for casedkey, mappedvalue in self._store.values()) 61 | 62 | def __len__(self): 63 | return len(self._store) 64 | 65 | def lower_items(self): 66 | """Like iteritems(), but with all lowercase keys.""" 67 | return ( 68 | (lowerkey, keyval[1]) 69 | for (lowerkey, keyval) 70 | in self._store.items() 71 | ) 72 | 73 | def __eq__(self, other): 74 | if isinstance(other, collections.Mapping): 75 | other = CaseInsensitiveDict(other) 76 | else: 77 | return NotImplemented 78 | # Compare insensitively 79 | return dict(self.lower_items()) == dict(other.lower_items()) 80 | 81 | # Copy is required 82 | def copy(self): 83 | return CaseInsensitiveDict(self._store.values()) 84 | 85 | def __repr__(self): 86 | return str(dict(self.items())) 87 | 88 | 89 | class LookupDict(dict): 90 | """Dictionary lookup object.""" 91 | 92 | def __init__(self, name=None): 93 | self.name = name 94 | super(LookupDict, self).__init__() 95 | 96 | def __repr__(self): 97 | return '' % (self.name) 98 | 99 | def __getitem__(self, key): 100 | # We allow fall-through here, so values default to None 101 | 102 | return self.__dict__.get(key, None) 103 | 104 | def get(self, key, default=None): 105 | return self.__dict__.get(key, default) 106 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/chardet/sbcsgroupprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # 13 | # This library is free software; you can redistribute it and/or 14 | # modify it under the terms of the GNU Lesser General Public 15 | # License as published by the Free Software Foundation; either 16 | # version 2.1 of the License, or (at your option) any later version. 17 | # 18 | # This library is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | # Lesser General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU Lesser General Public 24 | # License along with this library; if not, write to the Free Software 25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 26 | # 02110-1301 USA 27 | ######################### END LICENSE BLOCK ######################### 28 | 29 | from .charsetgroupprober import CharSetGroupProber 30 | from .sbcharsetprober import SingleByteCharSetProber 31 | from .langcyrillicmodel import (Win1251CyrillicModel, Koi8rModel, 32 | Latin5CyrillicModel, MacCyrillicModel, 33 | Ibm866Model, Ibm855Model) 34 | from .langgreekmodel import Latin7GreekModel, Win1253GreekModel 35 | from .langbulgarianmodel import Latin5BulgarianModel, Win1251BulgarianModel 36 | from .langhungarianmodel import Latin2HungarianModel, Win1250HungarianModel 37 | from .langthaimodel import TIS620ThaiModel 38 | from .langhebrewmodel import Win1255HebrewModel 39 | from .hebrewprober import HebrewProber 40 | 41 | 42 | class SBCSGroupProber(CharSetGroupProber): 43 | def __init__(self): 44 | CharSetGroupProber.__init__(self) 45 | self._mProbers = [ 46 | SingleByteCharSetProber(Win1251CyrillicModel), 47 | SingleByteCharSetProber(Koi8rModel), 48 | SingleByteCharSetProber(Latin5CyrillicModel), 49 | SingleByteCharSetProber(MacCyrillicModel), 50 | SingleByteCharSetProber(Ibm866Model), 51 | SingleByteCharSetProber(Ibm855Model), 52 | SingleByteCharSetProber(Latin7GreekModel), 53 | SingleByteCharSetProber(Win1253GreekModel), 54 | SingleByteCharSetProber(Latin5BulgarianModel), 55 | SingleByteCharSetProber(Win1251BulgarianModel), 56 | SingleByteCharSetProber(Latin2HungarianModel), 57 | SingleByteCharSetProber(Win1250HungarianModel), 58 | SingleByteCharSetProber(TIS620ThaiModel), 59 | ] 60 | hebrewProber = HebrewProber() 61 | logicalHebrewProber = SingleByteCharSetProber(Win1255HebrewModel, 62 | False, hebrewProber) 63 | visualHebrewProber = SingleByteCharSetProber(Win1255HebrewModel, True, 64 | hebrewProber) 65 | hebrewProber.set_model_probers(logicalHebrewProber, visualHebrewProber) 66 | self._mProbers.extend([hebrewProber, logicalHebrewProber, 67 | visualHebrewProber]) 68 | 69 | self.reset() 70 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/chardet/mbcharsetprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # Proofpoint, Inc. 13 | # 14 | # This library is free software; you can redistribute it and/or 15 | # modify it under the terms of the GNU Lesser General Public 16 | # License as published by the Free Software Foundation; either 17 | # version 2.1 of the License, or (at your option) any later version. 18 | # 19 | # This library is distributed in the hope that it will be useful, 20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 22 | # Lesser General Public License for more details. 23 | # 24 | # You should have received a copy of the GNU Lesser General Public 25 | # License along with this library; if not, write to the Free Software 26 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 27 | # 02110-1301 USA 28 | ######################### END LICENSE BLOCK ######################### 29 | 30 | import sys 31 | from . import constants 32 | from .charsetprober import CharSetProber 33 | 34 | 35 | class MultiByteCharSetProber(CharSetProber): 36 | def __init__(self): 37 | CharSetProber.__init__(self) 38 | self._mDistributionAnalyzer = None 39 | self._mCodingSM = None 40 | self._mLastChar = [0, 0] 41 | 42 | def reset(self): 43 | CharSetProber.reset(self) 44 | if self._mCodingSM: 45 | self._mCodingSM.reset() 46 | if self._mDistributionAnalyzer: 47 | self._mDistributionAnalyzer.reset() 48 | self._mLastChar = [0, 0] 49 | 50 | def get_charset_name(self): 51 | pass 52 | 53 | def feed(self, aBuf): 54 | aLen = len(aBuf) 55 | for i in range(0, aLen): 56 | codingState = self._mCodingSM.next_state(aBuf[i]) 57 | if codingState == constants.eError: 58 | if constants._debug: 59 | sys.stderr.write(self.get_charset_name() 60 | + ' prober hit error at byte ' + str(i) 61 | + '\n') 62 | self._mState = constants.eNotMe 63 | break 64 | elif codingState == constants.eItsMe: 65 | self._mState = constants.eFoundIt 66 | break 67 | elif codingState == constants.eStart: 68 | charLen = self._mCodingSM.get_current_charlen() 69 | if i == 0: 70 | self._mLastChar[1] = aBuf[0] 71 | self._mDistributionAnalyzer.feed(self._mLastChar, charLen) 72 | else: 73 | self._mDistributionAnalyzer.feed(aBuf[i - 1:i + 1], 74 | charLen) 75 | 76 | self._mLastChar[0] = aBuf[aLen - 1] 77 | 78 | if self.get_state() == constants.eDetecting: 79 | if (self._mDistributionAnalyzer.got_enough_data() and 80 | (self.get_confidence() > constants.SHORTCUT_THRESHOLD)): 81 | self._mState = constants.eFoundIt 82 | 83 | return self.get_state() 84 | 85 | def get_confidence(self): 86 | return self._mDistributionAnalyzer.get_confidence() 87 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/status_codes.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from .structures import LookupDict 4 | 5 | _codes = { 6 | 7 | # Informational. 8 | 100: ('continue',), 9 | 101: ('switching_protocols',), 10 | 102: ('processing',), 11 | 103: ('checkpoint',), 12 | 122: ('uri_too_long', 'request_uri_too_long'), 13 | 200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/', '✓'), 14 | 201: ('created',), 15 | 202: ('accepted',), 16 | 203: ('non_authoritative_info', 'non_authoritative_information'), 17 | 204: ('no_content',), 18 | 205: ('reset_content', 'reset'), 19 | 206: ('partial_content', 'partial'), 20 | 207: ('multi_status', 'multiple_status', 'multi_stati', 'multiple_stati'), 21 | 208: ('already_reported',), 22 | 226: ('im_used',), 23 | 24 | # Redirection. 25 | 300: ('multiple_choices',), 26 | 301: ('moved_permanently', 'moved', '\\o-'), 27 | 302: ('found',), 28 | 303: ('see_other', 'other'), 29 | 304: ('not_modified',), 30 | 305: ('use_proxy',), 31 | 306: ('switch_proxy',), 32 | 307: ('temporary_redirect', 'temporary_moved', 'temporary'), 33 | 308: ('permanent_redirect', 34 | 'resume_incomplete', 'resume',), # These 2 to be removed in 3.0 35 | 36 | # Client Error. 37 | 400: ('bad_request', 'bad'), 38 | 401: ('unauthorized',), 39 | 402: ('payment_required', 'payment'), 40 | 403: ('forbidden',), 41 | 404: ('not_found', '-o-'), 42 | 405: ('method_not_allowed', 'not_allowed'), 43 | 406: ('not_acceptable',), 44 | 407: ('proxy_authentication_required', 'proxy_auth', 'proxy_authentication'), 45 | 408: ('request_timeout', 'timeout'), 46 | 409: ('conflict',), 47 | 410: ('gone',), 48 | 411: ('length_required',), 49 | 412: ('precondition_failed', 'precondition'), 50 | 413: ('request_entity_too_large',), 51 | 414: ('request_uri_too_large',), 52 | 415: ('unsupported_media_type', 'unsupported_media', 'media_type'), 53 | 416: ('requested_range_not_satisfiable', 'requested_range', 'range_not_satisfiable'), 54 | 417: ('expectation_failed',), 55 | 418: ('im_a_teapot', 'teapot', 'i_am_a_teapot'), 56 | 421: ('misdirected_request',), 57 | 422: ('unprocessable_entity', 'unprocessable'), 58 | 423: ('locked',), 59 | 424: ('failed_dependency', 'dependency'), 60 | 425: ('unordered_collection', 'unordered'), 61 | 426: ('upgrade_required', 'upgrade'), 62 | 428: ('precondition_required', 'precondition'), 63 | 429: ('too_many_requests', 'too_many'), 64 | 431: ('header_fields_too_large', 'fields_too_large'), 65 | 444: ('no_response', 'none'), 66 | 449: ('retry_with', 'retry'), 67 | 450: ('blocked_by_windows_parental_controls', 'parental_controls'), 68 | 451: ('unavailable_for_legal_reasons', 'legal_reasons'), 69 | 499: ('client_closed_request',), 70 | 71 | # Server Error. 72 | 500: ('internal_server_error', 'server_error', '/o\\', '✗'), 73 | 501: ('not_implemented',), 74 | 502: ('bad_gateway',), 75 | 503: ('service_unavailable', 'unavailable'), 76 | 504: ('gateway_timeout',), 77 | 505: ('http_version_not_supported', 'http_version'), 78 | 506: ('variant_also_negotiates',), 79 | 507: ('insufficient_storage',), 80 | 509: ('bandwidth_limit_exceeded', 'bandwidth'), 81 | 510: ('not_extended',), 82 | 511: ('network_authentication_required', 'network_auth', 'network_authentication'), 83 | } 84 | 85 | codes = LookupDict(name='status_codes') 86 | 87 | for code, titles in _codes.items(): 88 | for title in titles: 89 | setattr(codes, title, code) 90 | if not title.startswith('\\'): 91 | setattr(codes, title.upper(), code) 92 | -------------------------------------------------------------------------------- /op5/scripts/jec_action_executor.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import json 3 | import logging 4 | import sys 5 | 6 | import requests 7 | from requests.auth import HTTPBasicAuth 8 | 9 | parser = argparse.ArgumentParser() 10 | parser.add_argument('-payload', '--queuePayload', help='Payload from queue', required=True) 11 | parser.add_argument('-apiKey', '--apiKey', help='The apiKey of the integration', required=True) 12 | parser.add_argument('-jsmUrl', '--jsmUrl', help='The url', required=True) 13 | parser.add_argument('-logLevel', '--logLevel', help='Log Level', required=True) 14 | parser.add_argument('-username', '--username', help='Username', required=False) 15 | parser.add_argument('-password', '--password', help='Password', required=False) 16 | parser.add_argument('-url', '--url', help='Url', required=False) 17 | args, unknown = parser.parse_known_args() 18 | args = vars(args) 19 | 20 | logging.basicConfig(stream=sys.stdout, level=args['logLevel']) 21 | 22 | 23 | def parse_field(key, mandatory): 24 | variable = queue_message.get(key) 25 | if not variable: 26 | variable = args.get(key) 27 | if mandatory and not variable: 28 | logging.error(LOG_PREFIX + " Skipping action, Mandatory conf item '" + str(key) + 29 | "' is missing. Check your configuration file.") 30 | raise ValueError(LOG_PREFIX + " Skipping action, Mandatory conf item '" + str(key) + 31 | "' is missing. Check your configuration file.") 32 | return variable 33 | 34 | 35 | def parse_timeout(): 36 | parsed_timeout = args.get('http.timeout') 37 | if not parsed_timeout: 38 | return 30000 39 | return int(parsed_timeout) 40 | 41 | 42 | def post_to_op5(post_params, typeOfNotification): 43 | url = parse_field("url", True) + "/api/command/" 44 | if typeOfNotification == "service": 45 | url += "ACKNOWLEDGE_SVC_PROBLEM" 46 | elif typeOfNotification == "host": 47 | url += "ACKNOWLEDGE_HOST_PROBLEM" 48 | 49 | username = parse_field("username", True) 50 | password = parse_field("password", True) 51 | logging.debug("Username: " + str(username)) 52 | 53 | token = HTTPBasicAuth(username, password) 54 | 55 | logging.debug(LOG_PREFIX + " Posting to OP5. Url: " + str(url) + " params: " + str(post_params)) 56 | response = requests.post(url, data=post_params, auth=token, timeout=parse_timeout()) 57 | if response and response.status_code == 200: 58 | logging.info(LOG_PREFIX + " Successfully executed at OP5.") 59 | logging.debug(LOG_PREFIX + " OP5 response: " + str(response.content)) 60 | else: 61 | logging.error( 62 | LOG_PREFIX + " Could not execute at OP5. StatusCode: " + str(response.status_code) + " Response: " + str( 63 | response.content)) 64 | 65 | 66 | def main(): 67 | global LOG_PREFIX 68 | global queue_message 69 | 70 | queue_message_string = args['queuePayload'] 71 | queue_message = json.loads(queue_message_string) 72 | 73 | alert_id = queue_message["alert"]["alertId"] 74 | mapped_action = queue_message["mappedActionV2"]["name"] 75 | 76 | LOG_PREFIX = "[" + mapped_action + "]" 77 | logging.info("Will execute " + str(mapped_action) + " for alertId " + str(alert_id)) 78 | 79 | post_params = { 80 | "host_name": queue_message.get("host_name"), 81 | "sticky": queue_message.get("sticky"), 82 | "notify": queue_message.get("notify"), 83 | "persistent": queue_message.get("persistent"), 84 | "comment": queue_message.get("comment") 85 | } 86 | 87 | service = queue_message.get("service_desc") 88 | if service: 89 | post_params.update({"service_description": service}) 90 | post_to_op5(post_params, "service") 91 | else: 92 | post_to_op5(post_params, "host") 93 | 94 | if __name__ == '__main__': 95 | main() 96 | -------------------------------------------------------------------------------- /signal-sciences/scripts/requests/packages/chardet/eucjpprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | import sys 29 | from . import constants 30 | from .mbcharsetprober import MultiByteCharSetProber 31 | from .codingstatemachine import CodingStateMachine 32 | from .chardistribution import EUCJPDistributionAnalysis 33 | from .jpcntx import EUCJPContextAnalysis 34 | from .mbcssm import EUCJPSMModel 35 | 36 | 37 | class EUCJPProber(MultiByteCharSetProber): 38 | def __init__(self): 39 | MultiByteCharSetProber.__init__(self) 40 | self._mCodingSM = CodingStateMachine(EUCJPSMModel) 41 | self._mDistributionAnalyzer = EUCJPDistributionAnalysis() 42 | self._mContextAnalyzer = EUCJPContextAnalysis() 43 | self.reset() 44 | 45 | def reset(self): 46 | MultiByteCharSetProber.reset(self) 47 | self._mContextAnalyzer.reset() 48 | 49 | def get_charset_name(self): 50 | return "EUC-JP" 51 | 52 | def feed(self, aBuf): 53 | aLen = len(aBuf) 54 | for i in range(0, aLen): 55 | # PY3K: aBuf is a byte array, so aBuf[i] is an int, not a byte 56 | codingState = self._mCodingSM.next_state(aBuf[i]) 57 | if codingState == constants.eError: 58 | if constants._debug: 59 | sys.stderr.write(self.get_charset_name() 60 | + ' prober hit error at byte ' + str(i) 61 | + '\n') 62 | self._mState = constants.eNotMe 63 | break 64 | elif codingState == constants.eItsMe: 65 | self._mState = constants.eFoundIt 66 | break 67 | elif codingState == constants.eStart: 68 | charLen = self._mCodingSM.get_current_charlen() 69 | if i == 0: 70 | self._mLastChar[1] = aBuf[0] 71 | self._mContextAnalyzer.feed(self._mLastChar, charLen) 72 | self._mDistributionAnalyzer.feed(self._mLastChar, charLen) 73 | else: 74 | self._mContextAnalyzer.feed(aBuf[i - 1:i + 1], charLen) 75 | self._mDistributionAnalyzer.feed(aBuf[i - 1:i + 1], 76 | charLen) 77 | 78 | self._mLastChar[0] = aBuf[aLen - 1] 79 | 80 | if self.get_state() == constants.eDetecting: 81 | if (self._mContextAnalyzer.got_enough_data() and 82 | (self.get_confidence() > constants.SHORTCUT_THRESHOLD)): 83 | self._mState = constants.eFoundIt 84 | 85 | return self.get_state() 86 | 87 | def get_confidence(self): 88 | contxtCf = self._mContextAnalyzer.get_confidence() 89 | distribCf = self._mDistributionAnalyzer.get_confidence() 90 | return max(contxtCf, distribCf) 91 | --------------------------------------------------------------------------------