Skip to content

Commit

Permalink
Updated to 1.2.0 - Removed SERVERS due to EOL
Browse files Browse the repository at this point in the history
  • Loading branch information
Kubik-Rubik committed Dec 6, 2017
1 parent 8eb2298 commit 9dddf9d
Show file tree
Hide file tree
Showing 18 changed files with 122 additions and 169 deletions.
12 changes: 12 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 1.2.0

* [*] Removed "SERVERS" tools due to EOL

# 1.1.0

* [+] Direct links to the dashboard of New Relic
* [*] Minor improvements

# 1.0.0

* [+] First release of the New Relic Plesk extension
3 changes: 1 addition & 2 deletions DESCRIPTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ New Relic is a software analytics tool suite used by developers, ops, and softwa

With New Relic, you gain access to analytics tools to measure and monitor performance bottlenecks, throughput, network graph, server health and many more – all almost in real-time.

The New Relic Plesk extension seamlessly integrates with your Plesk server, and supports the two most important tools by New Relic:
The New Relic Plesk extension seamlessly integrates with your Plesk server, and supports one of the most important tools by New Relic:

- APM for Application Performance Monitoring and Management
- SERVERS for Server Monitoring

Supported operation systems: Ubuntu, Debian, CentOs and Red Hat
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Viktor Vogel <[email protected]>
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ This extension adds the support of the application performance monitoring tool *

A software analytics tool suite used by developers, ops, and software companies to understand how your applications are performing in development and production.

Supported services: SERVERS, APM
Supported services: APM

Supported operation systems: Ubuntu, Debian, CentOs and Red Hat
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ This extension adds the support of the application performance monitoring tool *

A software analytics tool suite used by developers, ops, and software companies to understand how your applications are performing in development and production.

Supported services: SERVERS, APM
Supported services: APM

Supported operation systems: Ubuntu, Debian, CentOs and Red Hat
Binary file modified _meta/screenshots/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _meta/screenshots/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed _meta/screenshots/3.png
Binary file not shown.
2 changes: 1 addition & 1 deletion meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<id>new-relic</id>
<name>New Relic - Application Performance Monitoring</name>
<description>A software analytics tool suite used by developers, ops, and software companies to understand how your applications are performing in development and production.</description>
<version>1.1.0</version>
<version>1.2.0</version>
<release>1</release>
<vendor>Plesk</vendor>
<url>http://www.plesk.com</url>
Expand Down
123 changes: 79 additions & 44 deletions plib/controllers/IndexController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

// Copyright 1999-2016. Parallels IP Holdings GmbH.
// Copyright 1999-2017. Parallels IP Holdings GmbH.

class IndexController extends pm_Controller_Action
{
Expand Down Expand Up @@ -32,12 +32,44 @@ public function formAction()

// Init form here
$form = new pm_Form_Simple();
$form->addElement('text', 'license_key', ['label' => $this->lmsg('form_license_key'), 'value' => pm_Settings::get('license_key'), 'required' => true, 'validators' => [['NotEmpty', true],],]);
$form->addElement('text', 'server_name', ['label' => $this->lmsg('form_server_name'), 'value' => pm_Settings::get('server_name'), 'required' => true, 'validators' => [['NotEmpty', true],],]);
$form->addElement('text', 'account_id', ['label' => $this->lmsg('form_account_id'), 'value' => pm_Settings::get('account_id'), 'required' => false, 'validators' => [['Digits', true],],]);
$this->installationType('servers', $form);
$form->addElement('text', 'license_key', [
'label' => $this->lmsg('form_license_key'),
'value' => pm_Settings::get('license_key'),
'required' => true,
'validators' => [
[
'NotEmpty',
true
],
],
]);
$form->addElement('text', 'server_name', [
'label' => $this->lmsg('form_server_name'),
'value' => pm_Settings::get('server_name'),
'required' => true,
'validators' => [
[
'NotEmpty',
true
],
],
]);
$form->addElement('text', 'account_id', [
'label' => $this->lmsg('form_account_id'),
'value' => pm_Settings::get('account_id'),
'required' => false,
'validators' => [
[
'Digits',
true
],
],
]);
$this->installationType('apm', $form);
$form->addControlButtons(['sendTitle' => $this->lmsg('form_button_send'), 'cancelLink' => pm_Context::getModulesListUrl(),]);
$form->addControlButtons([
'sendTitle' => $this->lmsg('form_button_send'),
'cancelLink' => pm_Context::getModulesListUrl(),
]);

// Process the form - save the license key and run the installation scripts
if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {
Expand Down Expand Up @@ -86,14 +118,9 @@ private function setDescriptionLink()
$account_id = pm_Settings::get('account_id');

if (!empty($account_id)) {
$servers = pm_Settings::get('servers');
$apm = pm_Settings::get('apm');

if (!empty($servers) AND !empty($apm)) {
$this->view->output_description_link = $this->addSpanTranslation('output_description_link_ser_apm', 'description-extension', ['accountid' => $account_id]);
} elseif (!empty($servers)) {
$this->view->output_description_link = $this->addSpanTranslation('output_description_link_servers', 'description-extension', ['accountid' => $account_id]);
} elseif (!empty($apm)) {
if (!empty($apm)) {
$this->view->output_description_link = $this->addSpanTranslation('output_description_link_apm', 'description-extension', ['accountid' => $account_id]);
}
}
Expand All @@ -110,48 +137,64 @@ private function installationType($type, &$form)
{
$installation_done = $this->checkInstallationState($type);

if ($type == 'servers') {
$form->addElement('description', 'type_servers_logo', ['description' => $this->addSpanTranslation('form_type_servers_logo', 'logo-product-servers'), 'escape' => false]);
if ($installation_done == false) {
$form->addElement('description', 'servers_install', ['description' => $this->addSpanTranslation('form_type_servers_install', 'product-installed-servers'), 'escape' => false]);
$form->addElement('checkbox', 'servers', ['label' => $this->lmsg('form_type_servers'), 'value' => pm_Settings::get('servers'), 'checked' => true]);
} else {
$form->addElement('description', 'servers_installed', ['description' => $this->addSpanTranslation('form_type_servers_installed', 'product-installed-servers'), 'escape' => false]);
$form->addElement('checkbox', 'servers', ['label' => $this->lmsg('form_type_servers_reinstall'), 'value' => '', 'checked' => false]);
}

$form->addElement('description', 'type_servers_description', ['description' => $this->addSpanTranslation('form_type_servers_description', 'description-product'), 'escape' => false]);

return;
}

if ($type == 'apm') {
$form->addElement('description', 'type_apm_logo', ['description' => $this->addSpanTranslation('form_type_apm_logo', 'logo-product-apm'), 'escape' => false]);
$form->addElement('description', 'type_apm_logo', [
'description' => $this->addSpanTranslation('form_type_apm_logo', 'logo-product-apm'),
'escape' => false
]);

if ($installation_done == false) {
$form->addElement('description', 'apm_install', ['description' => $this->addSpanTranslation('form_type_apm_install', 'product-installed-apm'), 'escape' => false]);
$form->addElement('checkbox', 'apm', ['label' => $this->lmsg('form_type_apm'), 'value' => pm_Settings::get('apm'), 'checked' => true]);
$form->addElement('description', 'apm_install', [
'description' => $this->addSpanTranslation('form_type_apm_install', 'product-installed-apm'),
'escape' => false
]);
$form->addElement('checkbox', 'apm', [
'label' => $this->lmsg('form_type_apm'),
'value' => pm_Settings::get('apm'),
'checked' => true
]);
} else {
$form->addElement('description', 'apm_installed', ['description' => $this->addSpanTranslation('form_type_apm_installed', 'product-installed-apm'), 'escape' => false]);
$form->addElement('checkbox', 'apm', ['label' => $this->lmsg('form_type_apm_reinstall'), 'value' => '', 'checked' => false]);
$form->addElement('description', 'apm_installed', [
'description' => $this->addSpanTranslation('form_type_apm_installed', 'product-installed-apm'),
'escape' => false
]);
$form->addElement('checkbox', 'apm', [
'label' => $this->lmsg('form_type_apm_reinstall'),
'value' => '',
'checked' => false
]);
}

$php_versions = $this->getPleskPhpVersions();

if (!empty($php_versions)) {
$form->addElement('description', 'type_apm_php_versions', ['description' => $this->addSpanTranslation('form_type_apm_php_versions', 'description-php-versions'), 'escape' => false]);
$form->addElement('description', 'type_apm_php_versions', [
'description' => $this->addSpanTranslation('form_type_apm_php_versions', 'description-php-versions'),
'escape' => false
]);
foreach ($php_versions as $php_version => $php_bin_path) {
if ($this->checkInstallationState('php_versions_'.str_replace('.', '', $php_version))) {
$form->addElement('checkbox', 'php_versions_'.$php_version, ['label' => $php_version.' ['.$this->lmsg('form_type_apm_php_activated').']', 'value' => '', 'checked' => false]);
$form->addElement('checkbox', 'php_versions_'.$php_version, [
'label' => $php_version.' ['.$this->lmsg('form_type_apm_php_activated').']',
'value' => '',
'checked' => false
]);

continue;
}

$form->addElement('checkbox', 'php_versions_'.$php_version, ['label' => $php_version, 'value' => '', 'checked' => true]);
$form->addElement('checkbox', 'php_versions_'.$php_version, [
'label' => $php_version,
'value' => '',
'checked' => true
]);
}
}

$form->addElement('description', 'type_apm_description', ['description' => $this->addSpanTranslation('form_type_apm_description', 'description-product'), 'escape' => false]);
$form->addElement('description', 'type_apm_description', [
'description' => $this->addSpanTranslation('form_type_apm_description', 'description-product'),
'escape' => false
]);
}
}

Expand Down Expand Up @@ -219,14 +262,6 @@ private function processPostRequest($form)

$this->_status->addMessage('info', $this->lmsg('message_success'));

if ($form->getValue('servers')) {
if ($this->runInstallation('servers', $license_key, $server_name)) {
pm_Settings::set('servers', $form->getValue('servers'));

$this->_status->addMessage('info', $this->lmsg('message_success_servers'));
}
}

if ($form->getValue('apm')) {
$php_versions = $this->getSelectedPleskPhpVersion();

Expand Down
52 changes: 22 additions & 30 deletions plib/resources/locales/en-US.php
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
<?php
// Copyright 1999-2016. Parallels IP Holdings GmbH.
// Copyright 1999-2017. Parallels IP Holdings GmbH.

$messages = [
'message_success' => 'Data was successfully saved!',
'message_success_servers' => 'SERVERS was successfully installed!',
'message_success_apm' => 'APM was successfully installed!',
'message_error_key' => 'License Key must be 40 characters exactly!',
'message_warning_php_version' => 'Please select at least one PHP version!',
'message_warning_select_apm' => 'Please also select the APM installation field to activate the service for another PHP version!',
'page_title' => 'New Relic - Application Performance Monitoring',
'output_description' => 'A software analytics tool suite used by developers, ops, and software companies to understand how your applications are performing in development and production.',
'output_description_signup' => 'Don\'t have an account at New Relic yet? Sign up for free <a href="https://newrelic.com/" target="_blank">here</a>! No credit card necessary.',
'output_description_link_login' => 'Sign in to your New Relic account: <a href="https://login.newrelic.com/login" target="_blank">New Relic Login</a>. Enter your Account ID to activate direct links to the components!',
'output_description_link_ser_apm' => 'Open the <a href="https://rpm.newrelic.com/accounts/%%accountid%%/servers" target="_blank">SERVERS</a> dashboard / <a href="https://rpm.newrelic.com/accounts/%%accountid%%/applications" target="_blank">APM</a> dashboard.',
'output_description_link_servers' => 'Open the <a href="https://rpm.newrelic.com/accounts/%%accountid%%/servers" target="_blank">SERVERS</a> dashboard.',
'output_description_link_apm' => 'Open the <a href="https://rpm.newrelic.com/accounts/%%accountid%%/applications" target="_blank">APM</a> dashboard.',
'form_license_key' => 'License Key',
'form_server_name' => 'Server Name',
'form_account_id' => 'Account ID',
'form_type_servers' => 'Install SERVERS',
'form_type_servers_reinstall' => 'Re-Install SERVERS',
'form_type_servers_logo' => '<img src="new-relic-servers.png" alt="New Relic - APM" />',
'form_type_servers_description' => 'Monitor server health to track capacity, memory or CPU consumption. More info: <a href="https://newrelic.com/server-monitoring" target="_blank">New Relic SERVERS</a>',
'form_type_apm' => 'Install APM',
'form_type_apm_php_versions' => 'Select PHP versions',
'form_type_apm_reinstall' => 'Re-Install APM',
'form_type_apm_logo' => '<img src="new-relic-apm.png" alt="New Relic - APM" />',
'form_type_apm_description' => 'Get code level visibility for all your production apps. We help monitor over 3 million applications across six languages. More info: <a href="https://newrelic.com/application-monitoring" target="_blank">New Relic APM</a>.',
'form_type_servers_installed' => '<img src="check.png" alt="New Relic SERVERS is installed" /> New Relic SERVERS is installed!',
'form_type_apm_installed' => '<img src="check.png" alt="New Relic APM is installed" /> New Relic APM is installed!',
'form_type_apm_php_activated' => 'activated',
'form_button_send' => 'Install'
'form_account_id' => 'Account ID',
'form_button_send' => 'Install',
'form_license_key' => 'License Key',
'form_server_name' => 'Server Name',
'form_type_apm' => 'Install APM',
'form_type_apm_description' => 'Get code level visibility for all your production apps. We help monitor over 3 million applications across six languages. More info: <a href="https://newrelic.com/application-monitoring" target="_blank">New Relic APM</a>.',
'form_type_apm_installed' => '<img src="check.png" alt="New Relic APM is installed" /> New Relic APM is installed!',
'form_type_apm_logo' => '<img src="new-relic-apm.png" alt="New Relic - APM" />',
'form_type_apm_php_activated' => 'activated',
'form_type_apm_php_versions' => 'Select PHP versions',
'form_type_apm_reinstall' => 'Re-Install APM',
'message_error_key' => 'License Key must be 40 characters exactly!',
'message_success' => 'Data was successfully saved!',
'message_success_apm' => 'APM was successfully installed!',
'message_warning_php_version' => 'Please select at least one PHP version!',
'message_warning_select_apm' => 'Please also select the APM installation field to activate the service for another PHP version!',
'output_description' => 'A software analytics tool suite used by developers, ops, and software companies to understand how your applications are performing in development and production.',
'output_description_link_apm' => 'Open the <a href="https://rpm.newrelic.com/accounts/%%accountid%%/applications" target="_blank">APM</a> dashboard.',
'output_description_link_login' => 'Sign in to your New Relic account: <a href="https://login.newrelic.com/login" target="_blank">New Relic Login</a>. Enter your Account ID to activate direct links to the components!',
'output_description_signup' => 'Don\'t have an account at New Relic yet? Sign up for free <a href="https://newrelic.com/" target="_blank">here</a>! No credit card necessary.',
'page_title' => 'New Relic - Application Performance Monitoring',
];
2 changes: 1 addition & 1 deletion plib/scripts/post-install.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2016. Parallels IP Holdings GmbH.
// Copyright 1999-2017. Parallels IP Holdings GmbH.

pm_Context::init('new-relic');

Expand Down
2 changes: 1 addition & 1 deletion plib/scripts/pre-uninstall.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2016. Parallels IP Holdings GmbH.
// Copyright 1999-2017. Parallels IP Holdings GmbH.

pm_Context::init('new-relic');

Expand Down
2 changes: 1 addition & 1 deletion plib/views/scripts/index/form.phtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright 1999-2016. Parallels IP Holdings GmbH.
// Copyright 1999-2017. Parallels IP Holdings GmbH.
?>
<div id="newrelic">
<div class="logo">
Expand Down
2 changes: 1 addition & 1 deletion plib/views/scripts/index/index.phtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
// Copyright 1999-2016. Parallels IP Holdings GmbH.
// Copyright 1999-2017. Parallels IP Holdings GmbH.

exit();
10 changes: 0 additions & 10 deletions sbin/postinstallcheck.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
#!/bin/bash -e

if [ ! -f /usr/local/psa/var/modules/new-relic/removepackageservers ]
then
if [ ! -f /etc/init.d/newrelic-sysmond ];
then
echo "1" > "/usr/local/psa/var/modules/new-relic/removepackageservers"
else
echo "0" > "/usr/local/psa/var/modules/new-relic/removepackageservers"
fi
fi

if [ ! -f /usr/local/psa/var/modules/new-relic/removepackageapm ]
then
if [ -f /etc/redhat-release ];
Expand Down
29 changes: 0 additions & 29 deletions sbin/preuninstallcheck.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,5 @@
#!/bin/bash -e

REMOVESERVERS=`cat /usr/local/psa/var/modules/new-relic/removepackageservers`

if [ "$REMOVESERVERS" = "1" ];
then
if [ -f /etc/init.d/newrelic-sysmond ];
then
if [ -f /etc/redhat-release ];
then
yum -y -q remove newrelic-sysmond
yum -y -q remove newrelic-repo

if [ -f /etc/yum.repos.d/newrelic.repo ]
then
rm /etc/yum.repos.d/newrelic.repo
fi
else
apt-get -qq -y --purge autoremove newrelic-sysmond

if [ -f /etc/apt/sources.list.d/newrelic.list ]
then
rm /etc/apt/sources.list.d/newrelic.list
fi
fi
fi
fi

# Add sleep of 6 seconds to avoid process lock issues
sleep 6

REMOVEAPM=`cat /usr/local/psa/var/modules/new-relic/removepackageapm`

if [ "$REMOVEAPM" = "1" ];
Expand Down
Loading

0 comments on commit 9dddf9d

Please sign in to comment.