Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #20

Merged
merged 76 commits into from
Jul 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
561d32a
chore(build): use internal instead of packagist
kduret Jun 21, 2018
8285e31
fix(chore): Change install from sources to work with PHP 7 (#6388)
kduret Jun 21, 2018
a42475a
feat(pagination): persist selected results limit (#6392)
v-radev Jun 21, 2018
700e576
fix(clapi): fix trap export (#6394)
kduret Jun 22, 2018
2f38c8b
fix(clapi): fix export of services and ST
kduret Jun 22, 2018
8fec301
fix(test): fix acceptance test of realtime api (#6398)
Guillaume28 Jun 22, 2018
3537ed6
test(acceptance): replace clapi compare file from export test
kduret Jun 25, 2018
6ee3244
fix(sec): Fix SQL Injection in Virtual Metrics (#6257)
leoncx Jun 25, 2018
e692659
fix(sec): Fix SQL injection in Curve template (#6256)
leoncx Jun 25, 2018
3448c18
fix(sec): Fix XSS security on menu username (#6259)
leoncx Jun 25, 2018
394e66c
fix(sec): Fix SQL injection in dashboard (#6250)
leoncx Jun 25, 2018
443f055
fix(sec): Fix XSS on command form (#6251)
leoncx Jun 25, 2018
b9e07c3
fix(sec): Fix execution command by rrdtool command line (#6263)
leoncx Jun 25, 2018
292cf86
fix(db): remove duplicate entries in centreon_acl table (#6366)
sc979 Jun 25, 2018
e1df437
fix(sec): Fix SQL Injection in administration logs (#6255)
leoncx Jun 25, 2018
4448c63
Add Centreon web 2.8.24 release note (#6379)
lpinsivy Jun 25, 2018
9d545de
fix(clapi_export): Change list (#6402)
Guillaume28 Jun 25, 2018
8ce1f80
fix(doc): Add missing chapter to release note (#6403)
adr-mo Jun 25, 2018
5a51bdb
feat(widgets): add buttons to install and upgrade all (#6401)
v-radev Jun 27, 2018
6e08157
feat(searching): persist search term for host and host group (#6386)
v-radev Jun 27, 2018
7499b07
fix(clapi) fix aclgroup parent relation
loiclau Jun 27, 2018
fdeb1fd
feat(modules): add buttons to install and upgrade all (#6408)
v-radev Jun 28, 2018
6c9662c
fix(mon): bugs in event/system logs (#6389)
kduret Jun 29, 2018
4980952
Prevent memory leaks (#6412)
vhr Jun 29, 2018
52c512e
fix(monitoring): get rows count from query statement (#6415)
v-radev Jun 29, 2018
207e175
refactor(modules): make a single button to install and upgrade module…
v-radev Jul 2, 2018
5ffbd1a
fix(metaservice): Quickform element loading (#6419)
victorvassilev Jul 2, 2018
82b2ea1
fix(resources): add default value to form checkboxes (#6421)
v-radev Jul 2, 2018
66bdce2
fix(pagination): add count of all services results (#6424)
v-radev Jul 2, 2018
e005746
fix(widget): add option to skip using of PHP exit function (#6426)
vhr Jul 2, 2018
cd27be5
fix(config-command): update smarty/quickform loading (#6425)
victorvassilev Jul 2, 2018
d3f1beb
fix(ux): show a proper bg color of the submenu (#6427)
vhr Jul 3, 2018
cf6c0f9
fix(cron): remove useless include to avoid warning in acl cron (#6420)
kduret Jul 3, 2018
8c9b479
fix(monitoring): proper smarty loading and js attribute fix (#6429)
v-radev Jul 3, 2018
03197a2
Dst php7 (#6431)
loiclau Jul 4, 2018
a90cfd4
chore(test): set the entire KB configuration in related acceptance te…
Jul 4, 2018
38ff4ab
feat(conf): add JS validation of Time Range Exceptions (#6438)
vhr Jul 5, 2018
e9e3e93
fix(admin): fix PHP warnings in Administration > Parameters > Data an…
vhr Jul 5, 2018
016a2b6
fix(tests): update LDAP tests labels (because of changes in centreon-…
Jul 5, 2018
ac72530
Fix acceptance test (#6440)
loiclau Jul 5, 2018
6536284
fix(report): fix fetching data from DB in Reporting > Dashboards page…
vhr Jul 5, 2018
854a1f2
fix(report): missing colors color_maintenance and color_undetermined …
vhr Jul 5, 2018
dbe58c3
fix(ux): the mass selection doesn't work the second time (#6446)
vhr Jul 6, 2018
f0a4dbe
fix(cv): issue with moving of widgets (#6448)
vhr Jul 6, 2018
040a8f2
fix(README): Adding Stéphane Chapron to dev team (#6410)
adr-mo Jul 6, 2018
65fe424
doc(readme): Adding Mr Baldo to Dev Team. (#6253)
NicolasBeckDev Jul 6, 2018
1768e74
fix(conflict): fix rebase conflicts (#6382)
kduret Jul 6, 2018
10afeac
doc(broker): fix typo (#6375)
gabyfulchic Jul 6, 2018
2a54941
fix(clapi): avoid to order parentship several times (#6373)
kduret Jul 6, 2018
9a02fd0
fix(api): fix name of service statuses (#6363)
edhil Jul 6, 2018
a1a1eaa
fix(sec): Fix SQL injection from metrics RPN's field (#6356)
sc979 Jul 6, 2018
9aeb9b7
fix(ldap): remove contact password if ldap password storage is disabl…
kduret Jul 6, 2018
631dbfa
doc(broker): update doc of stream connector (#6296)
Jul 6, 2018
8a4d671
doc(broker): update fr doc of stream connector (#6295)
Jul 6, 2018
f532b21
enh(ui): Sort by service name in service grid (#6290)
richardlawley Jul 6, 2018
1634555
fix(downtimes): prevent permission denied to centcore cmd for downtim…
lpinsivy Jul 6, 2018
c5239fa
enh(ui): Delete "Ping" and "Tracert" entries (no more used) (#6277)
lpinsivy Jul 6, 2018
bbfcfaf
fix(ui): avoid php notice in UI notification (#6266)
smutel Jul 6, 2018
f049cf5
fix(api): Prevent semicolon in last value breaking rest clapi seriali…
richardlawley Jul 6, 2018
66bcf1c
fix(clapi): fix acl group setcontact export (#6224)
cgagnaire Jul 6, 2018
9705fc7
fix(clapi): fix resource setparam export (#6222)
cgagnaire Jul 6, 2018
331dd87
fix(clapi): fix broker endpoint ids offset (#6220)
cgagnaire Jul 6, 2018
2f0fb59
feat(api): add submit result (#6209)
julienmathis Jul 6, 2018
593d757
fix(notification): add service linked to host to contact notification…
kduret Jul 6, 2018
5340baf
fix(sql): fix query to create media directory
kduret Jul 9, 2018
87bac15
chore(upgrade): upgrade version to 2.8.25
kduret Jul 10, 2018
a161b68
fix(clapi) fix init host object
loiclau Jul 10, 2018
4eb4d87
fix(clapi) order host export
loiclau Jul 11, 2018
1760df3
fix(acceptance) use macro id instead of name #6222
loiclau Jul 11, 2018
d5033eb
fix(ux): make an immediately check_session request (#6456)
vhr Jul 12, 2018
a0a2ba3
feat(cv): upgrade library a jquery jeditable to version 2.0.5 (#6473)
vhr Jul 17, 2018
016d615
feat: new header
Ridene Jul 18, 2018
a57e7e4
fix(test) change unit test for menu
loiclau Jul 18, 2018
3457185
clean(menu) remove unused function
loiclau Jul 18, 2018
991836f
fix(pagination): remove history limiting check (#6483)
v-radev Jul 23, 2018
779d86d
fix(header) require autologout for date format
loiclau Jul 23, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"env": {
"test": {
"presets": ["env", "react", "stage-2"],
"plugins": ["transform-export-extensions"],
"only": [
"./**/*.js",
"node_modules/jest-runtime"
]
}
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.idea/
/nbproject/private/
nbproject/
node_modules/
/vendor/
composer.lock
GPL_LIB/SmartyCache/*
Expand All @@ -10,3 +11,5 @@ www/img/media/*
!www/install/tmp/.gitkeep
www/install/install.conf.php
config/centreon.config.php

*-dev.yml
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ try {
useDeltaValues: true,
failedNewAll: '0'
])
junit 'jest-test-results.xml'
}
},
'debian9': {
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ first.
* Romain Le Merlus

### Dev team
* Guillaume Baldo
* Lionel Assepo
* Maximilien Bersoult
* Stéphane Chapron
* Kevin Duret
* Loic Laurent
* Rabaa Ridene
Expand Down
20 changes: 20 additions & 0 deletions behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -326,3 +326,23 @@ default:
uri:
paths: [ %paths.base%/features/URI.feature ]
contexts: [ URIContext ]

newheaderfeatureflipping:
paths: [ %paths.base%/features/NewHeaderFeatureFlipping.feature ]
contexts: [ NewHeaderFeatureFlippingContext ]

topcounterprofilemenu:
paths: [ %paths.base%/features/TopCounterProfileMenu.feature ]
contexts: [ TopCounterProfileMenuContext ]

topcounterservice:
paths: [ %paths.base%/features/TopCounterServices.feature ]
contexts: [ TopCounterServicesContext ]

topcounterhost:
paths: [ %paths.base%/features/TopCounterHosts.feature ]
contexts: [ TopCounterHostsContext ]

topcounterpoller:
paths: [ %paths.base%/features/TopCounterPollers.feature ]
contexts: [ TopCounterPollersContext ]
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
}
],
"repositories": [
{ "type": "composer", "url": "https://packagist.centreon.com" }
{ "packagist.org": false },
{ "type": "composer", "url": "http://ci.int.centreon.com" }
],
"config": {
"secure-http": false
Expand Down
2 changes: 0 additions & 2 deletions cron/centAcl.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
*/
define('LDAP_UPDATE_PERIOD', 3600);

include_once "DB.php";

require_once realpath(dirname(__FILE__) . "/../config/centreon.config.php");
include_once _CENTREON_PATH_ . "/cron/centAcl-Func.php";
include_once _CENTREON_PATH_ . "/www/class/centreonDB.class.php";
Expand Down
131 changes: 115 additions & 16 deletions doc/en/api/api_rest/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,105 @@ Using GET method and the URL below: ::
api.domain.tld/centreon/api/index.php?action=list&object=centreon_realtime_services&limit=60&viewType=all&sortType=name&order=desc&fields=id,description,host_id,host_name,state,output


Submit results
--------------

You can use the centreon API to submit information to the monitoring engine. All information that you submit will be forwarded to the centreon engine poller that host the configuration.

To provide information, Centreon need to have specific and mandatory information.

The user must be admin or have access to "Reach API Configuration".

For the service submission please provide the following information :

+------------------+------------------------------------------+
| Fields | Description |
+==================+==========================================+
| host | host name |
+------------------+------------------------------------------+
| service | service description |
+------------------+------------------------------------------+
| status | status id (0, 1, 2, 3) |
| | or ok, warning, critical, unknown |
+------------------+------------------------------------------+
| output | a specific message |
+------------------+------------------------------------------+
| perfdata | all performance metric following the |
| (optional) | nagios plugin API |
+------------------+------------------------------------------+
| updatetime | the check time (timestamp) |
+------------------+------------------------------------------+

For the host submission please provide the following information :

+------------------+------------------------------------------+
| Fields | Description |
+==================+==========================================+
| host | host name |
+------------------+------------------------------------------+
| status | status id (0, 1, 2, 3) |
+------------------+------------------------------------------+
| output | a specific message |
+------------------+------------------------------------------+
| updatetime | the check time (timestamp) |
+------------------+------------------------------------------+

To send status, please use the following URL using POST method: ::

api.domain.tld/centreon/api/index.php?action=submit&object=centreon_submit_results

**Header**

+---------------------+---------------------------------+
| key | value |
| | |
+---------------------+---------------------------------+
| Content-Type | application/json |
+---------------------+---------------------------------+
| centreon-auth-token | the value of authToken you got |
| | on the authentication response |
+---------------------+---------------------------------+

**Example of service body submit:**
The body is a json with the parameters provided above formated as below: ::

{
"results": [
{
"updatetime": "1528884076",
"host": "Centreon-Central"
"service": "Memory",
"status": "2"
"output": "The service is in CRITICAL state"
"perfdata": "perf=20"
},
{
"updatetime": "1528884076",
"host": "Centreon-Central"
"service": "fake-service",
"status": "1"
"output": "The service is in WARNING state"
"perfdata": "perf=10"
}
]
}

**Example of body response:** ::
The response body is a json with the HTTP return code and a message for each submit: ::

{
"results": [
{
"code": 202,
"message": "The status send to the engine"
},
{
"code": 404,
"message": "The service is not present."
}
]
}

Configuration
-------------

Expand Down Expand Up @@ -364,15 +463,15 @@ Using POST method and the URL below: ::
{
"action": "show",
"object": "HOST"
}
}

* The key **action** corresponds to the option **-a** in Centreon CLAPI, the value **show** corresponds to the **-a** option value.
* The key **object** corresponds to the option **-o** in Centreon CLAPI, the value **HOST** corresponds to the **-o** option value.

The equivalent action using Centreon CLAPI is: ::

[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a show


**Response:**
The response is a json flow listing all hosts and formated as below: ::
Expand All @@ -392,7 +491,7 @@ The response is a json flow listing all hosts and formated as below: ::
"alias": "mail-neptune-frontend",
"address": "mail-neptune-frontend",
"activate": "1"
},
},
{
"id": "14",
"name": "srvi-mysql01",
Expand Down Expand Up @@ -725,7 +824,7 @@ Set instance poller
}


Get macro
Get macro
##########

**POST** ::
Expand Down Expand Up @@ -756,7 +855,7 @@ Get macro



**Response**
**Response**
Here is a response example ::

{
Expand Down Expand Up @@ -818,7 +917,7 @@ Set macro
To edit an existing custom marco, The MacroName used on the body should be defined on the Custom Marco of the choosen host. If the marco doesn't exist, it will be created.

**Response** ::

{
"result": []
}
Expand Down Expand Up @@ -853,7 +952,7 @@ Delete macro
"values": "mail-uranus-frontend;MacroName"
}

The MacroName used on the body is the macro to delete. It should be defined on the Custom Marco of the choosen host.
The MacroName used on the body is the macro to delete. It should be defined on the Custom Marco of the choosen host.

**Response** ::

Expand Down Expand Up @@ -895,7 +994,7 @@ Get template

**Response**
Here is a response example ::

{
"result": [
{
Expand Down Expand Up @@ -949,7 +1048,7 @@ The MyHostTemplate used on the body should exist as a host template. The new tem
**Response** ::
{
"result": []
}
}



Expand Down Expand Up @@ -982,7 +1081,7 @@ Add template
"values": "mail-uranus-frontend;MyHostTemplate"
}

The MyHostTemplate used on the body should exist as a host template. The new template is added without erasing template already linked
The MyHostTemplate used on the body should exist as a host template. The new template is added without erasing template already linked

**Response** ::
{
Expand Down Expand Up @@ -1019,7 +1118,7 @@ Delete template
"values": "mail-uranus-frontend;MyHostTemplate"
}

The MyHostTemplate used on the body should exist as a host template.
The MyHostTemplate used on the body should exist as a host template.

**Response** ::
{
Expand Down Expand Up @@ -1094,7 +1193,7 @@ Get parent


**Response** ::

{
"result": [
{
Expand All @@ -1103,7 +1202,7 @@ Get parent
}
]
}


Add parent
##########
Expand Down Expand Up @@ -1272,7 +1371,7 @@ Get contact group
}
]
}




Expand Down Expand Up @@ -1442,7 +1541,7 @@ Get contact
"name": "user-mail"
}
]
}
}


Add contact
Expand Down Expand Up @@ -2150,7 +2249,7 @@ Instances ( Pollers)
* del
* setparam
* gethosts


Service templates
~~~~~~~~~~~~~~~~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The prerequisites are the same as for Centreon Web in its 2.8.x version.
Mediawiki
*********

**Centreon Knowledge Base** requires **MediaWiki** to be installed (version = 1.21) on your system
**Centreon Knowledge Base** requires **MediaWiki** to be installed (version = 1.31) on your system
. Mediawiki is provided with RPM packages on Centreon repository.

You can `download MediaWiki here <http://www.mediawiki.org/wiki/MediaWiki>`_ and access the `documentation here <http://www.mediawiki.org/wiki/User_hub>`_.
Loading