diff --git a/.github/config.yml b/.github/config.yml new file mode 100644 index 0000000..b0bee1a --- /dev/null +++ b/.github/config.yml @@ -0,0 +1,34 @@ +# Configuration for welcome - https://github.com/behaviorbot/welcome + +# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome + +# Comment to be posted to on first time issues +newIssueWelcomeComment: | + ![Hello welcome GIF](https://media.giphy.com/media/bcKmIWkUMCjVm/giphy.gif) + Thank you so much for opening your first issue here! :cherry_blossom: + :white_check_mark: I hope you have kindly checked any other [opened issues](https://github.com/rvalitov/zabbix-php-fpm/issues) to make sure that it's not a duplicate :pray: + :white_check_mark: And you have read the [Wiki](https://github.com/rvalitov/zabbix-php-fpm/wiki) of this project that contains a full documentation, specifically the [Installation instructions](https://github.com/rvalitov/zabbix-php-fpm/wiki/Installation) and [Troubleshooting guide](https://github.com/rvalitov/zabbix-php-fpm/wiki/Testing-and-Troubleshooting) :innocent: + :information_source: You may add any additional information by editing your original post or by posting additional comments below. + :information_source: We need some time to read your issue and verify it, so please, be patient :innocent: + :information_source: Any questions or comments regarding your issue will be posted here below that may require your response. So, please, don't miss the Github notifications about new updates on this topic :wink: + + We will kindly investigate the information you provided and hopefully return to you as soon as possible! :blush: + +# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome + +# Comment to be posted to on PRs from first time contributors in your repository +newPRWelcomeComment: | + ![Thank you GIF](https://media.giphy.com/media/3o6Zt6KHxJTbXCnSvu/giphy.gif) + Thank you so much for opening this pull request! :blush::cherry_blossom: Your contribution is much appreciated! :pray: + It takes some time to make a review of your contribution before merging your code, so please, be patient :innocent: + Any questions or comments regarding your pull request will be posted here below that may require your response. So, please, don't miss the Github notifications about this pull request :wink: Thank you! + +# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge + +# Comment to be posted to on pull requests merged by a first time user +firstPRMergeComment: | + ![Happy dance GIF](https://media.giphy.com/media/Q8IYWnnogTYM5T6Yo0/giphy.gif) + Congrats on merging your first pull request! :clap::cherry_blossom: Thank you so much for your contribution! :pray: A really good work! :muscle::thumbsup: + If you would like to improve this project any further, I will be happy to receive new pull requests from you! :innocent: + +# It is recommend to include as many gifs and emojis as possible \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 08c7f48..57dd101 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,6 +51,30 @@ jobs: - php-fpm before_script: - sudo curl -o /usr/local/bin/shunit2 https://raw.githubusercontent.com/kward/shunit2/master/shunit2 + - os: linux + dist: bionic + name: "Zabbix 5.0 @ Ubuntu 18 bionic, PHP default" + arch: amd64 + addons: + apt: + sources: + - sourceline: 'deb http://repo.zabbix.com/zabbix/5.0/ubuntu bionic main' + key_url: "https://repo.zabbix.com/zabbix-official-repo.key" + packages: + - ca-certificates + - curl + - grep + - sed + - gawk + - lsof + - jq + - libfcgi-bin + - unzip + - zabbix-agent + - zabbix-get + - php-fpm + before_script: + - sudo curl -o /usr/local/bin/shunit2 https://raw.githubusercontent.com/kward/shunit2/master/shunit2 - os: linux dist: bionic name: "Zabbix 4.0 @ Ubuntu 18 bionic, PHP 7.0-7.4" @@ -58,7 +82,7 @@ jobs: addons: apt: sources: - - sourceline: 'deb http://repo.zabbix.com/zabbix/4.4/ubuntu bionic main' + - sourceline: 'deb http://repo.zabbix.com/zabbix/4.0/ubuntu bionic main' key_url: "https://repo.zabbix.com/zabbix-official-repo.key" - sourceline: 'ppa:ondrej/php' packages: @@ -109,6 +133,35 @@ jobs: - php7.4-fpm before_script: - sudo curl -o /usr/local/bin/shunit2 https://raw.githubusercontent.com/kward/shunit2/master/shunit2 + - os: linux + dist: bionic + name: "Zabbix 5.0 @ Ubuntu 18 bionic, PHP 7.0-7.4" + arch: amd64 + addons: + apt: + sources: + - sourceline: 'deb http://repo.zabbix.com/zabbix/5.0/ubuntu bionic main' + key_url: "https://repo.zabbix.com/zabbix-official-repo.key" + - sourceline: 'ppa:ondrej/php' + packages: + - ca-certificates + - curl + - grep + - sed + - gawk + - lsof + - jq + - libfcgi-bin + - unzip + - zabbix-agent + - zabbix-get + - php7.0-fpm + - php7.1-fpm + - php7.2-fpm + - php7.3-fpm + - php7.4-fpm + before_script: + - sudo curl -o /usr/local/bin/shunit2 https://raw.githubusercontent.com/kward/shunit2/master/shunit2 script: bash tests/all.sh notifications: diff --git a/README.md b/README.md index 013cf0d..1cee9bb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PHP-FPM Zabbix Template with Auto Discovery and Multiple Pools -![Zabbix versions](https://img.shields.io/badge/Zabbix_versions-4.4,_4.2,_4.0-green.svg?style=flat) ![PHP](https://img.shields.io/badge/PHP-5.3.3+-blue.svg?style=flat) ![PHP7](https://img.shields.io/badge/PHP7-supported-green.svg?style=flat) ![LLD](https://img.shields.io/badge/LLD-yes-green.svg?style=flat) ![ISPConfig](https://img.shields.io/badge/ISPConfig-supported-green.svg?style=flat) [![Build Status](https://travis-ci.com/rvalitov/zabbix-php-fpm.svg?branch=master)](https://travis-ci.com/rvalitov/zabbix-php-fpm) +![Zabbix versions](https://img.shields.io/badge/Zabbix_versions-5.0,_4.4,_4.2,_4.0-green.svg?style=flat) ![PHP](https://img.shields.io/badge/PHP-5.3.3+-blue.svg?style=flat) ![PHP7](https://img.shields.io/badge/PHP7-supported-green.svg?style=flat) ![LLD](https://img.shields.io/badge/LLD-yes-green.svg?style=flat) ![ISPConfig](https://img.shields.io/badge/ISPConfig-supported-green.svg?style=flat) [![Build Status](https://travis-ci.com/rvalitov/zabbix-php-fpm.svg?branch=master)](https://travis-ci.com/rvalitov/zabbix-php-fpm) [![CodeFactor](https://www.codefactor.io/repository/github/rvalitov/zabbix-php-fpm/badge)](https://www.codefactor.io/repository/github/rvalitov/zabbix-php-fpm) ![Banner](https://github.com/rvalitov/zabbix-php-fpm/wiki/media/repository-open-graph-template.png) @@ -128,9 +128,9 @@ Can work with any version of ISPConfig as long as you have a valid PHP-FPM statu Tested with: - [Travis CI](https://travis-ci.com/rvalitov/zabbix-php-fpm) -- PHP 7.2, 7.3, 7.4 -- Zabbix 4.0.4, 4.0.16, 4.0.20, 4.2.5, 4.4.4 -- Debian 9, 10 +- PHP 7.4, 7.3, 7.2, 7.1, 7.0 +- Zabbix 5.0.1, 4.4.4, 4.2.5, 4.0.20, 4.0.16, 4.0.4 +- Debian 10, 9 - Ubuntu 18 - CentOS 7 - ISPConfig v.3.1.14p2 \ No newline at end of file diff --git a/tests/all.sh b/tests/all.sh index 8bc9a7c..071f4ad 100644 --- a/tests/all.sh +++ b/tests/all.sh @@ -98,11 +98,11 @@ getAnyPort() { } oneTimeSetUp() { + echo "Started job $TRAVIS_JOB_NAME" echo "Host info:" nslookup localhost sudo ifconfig sudo cat /etc/hosts - echo "Copying Zabbix files..." #Install files: sudo cp "$TRAVIS_BUILD_DIR/zabbix/zabbix_php_fpm_discovery.sh" "/etc/zabbix" @@ -128,6 +128,20 @@ testZabbixGetInstalled() { assertNotNull "Utility zabbix-get not installed" "$ZABBIX_GET" } +testZabbixAgentVersion() { + #Example: 4.4 + REQUESTED_VERSION=$(echo "$TRAVIS_JOB_NAME" | grep -i -F "zabbix" | head -n1 | cut -d "@" -f1 | cut -d " " -f2) + INSTALLED_VERSION=$(zabbix_agentd -V | grep -F "zabbix" | head -n1 | rev | cut -d " " -f1 | rev | cut -d "." -f1,2) + assertSame "Requested version $REQUESTED_VERSION and installed version $INSTALLED_VERSION of Zabbix agent do not match" "$REQUESTED_VERSION" "$INSTALLED_VERSION" +} + +testZabbixGetVersion() { + #Example: 4.4 + REQUESTED_VERSION=$(echo "$TRAVIS_JOB_NAME" | grep -i -F "zabbix" | head -n1 | cut -d "@" -f1 | cut -d " " -f2) + INSTALLED_VERSION=$(zabbix_get -V | grep -F "zabbix" | head -n1 | rev | cut -d " " -f1 | rev | cut -d "." -f1,2) + assertSame "Requested version $REQUESTED_VERSION and installed version $INSTALLED_VERSION of zabbix_get do not match" "$REQUESTED_VERSION" "$INSTALLED_VERSION" +} + testPHPIsRunning() { IS_OK=$(sudo ps ax | grep -F "php-fpm: pool " | grep -F -v "grep" | head -n1) assertNotNull "No running PHP-FPM instances found" "$IS_OK"