Skip to content

Commit aa4543d

Browse files
committed
Initial commit
0 parents  commit aa4543d

File tree

5,903 files changed

+1308311
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,903 files changed

+1308311
-0
lines changed

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
tmp/*
2+
[Cc]onfig/core.php
3+
[Cc]onfig/database.php
4+
app/tmp/*
5+
app/[Cc]onfig/core.php
6+
app/[Cc]onfig/database.php
7+
!empty
8+
lib/Cake/Console/Templates/skel/tmp/*
9+
._*
10+
.DS_Store
11+
.AppleDouble
12+
.afp*
13+
app/tmp_cli/*
14+
.nfs*
15+
.idea/*
16+
/nbproject/private/*
17+
app/Plugin/AutoreportModule/webroot/tmp/*
18+
app/webroot/userimages/*
19+
app/webroot/img/graphs/*
20+
app/webroot/img/charts/*
21+
app/Plugin/MapModule/webroot/img/backgrounds/*
22+
app/Plugin/MapModule/webroot/img/icons/*
23+
*.swp
24+
*.swo
25+
app/webroot/js/compressed_components.js
26+
app/webroot/js/compressed_controllers.js

.htaccess

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<IfModule mod_rewrite.c>
2+
RewriteEngine on
3+
RewriteRule ^$ app/webroot/ [L]
4+
RewriteRule (.*) app/webroot/$1 [L]
5+
</IfModule>

LICENSE

Lines changed: 675 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# What is openITCOCKPIT?
2+
openITCOCKPIT is an Open Source system monitoring tool build for different monitoring engines like [Nagios](https://www.nagios.org/) or [Naemon](http://www.naemon.org/).
3+
4+
So easy that everyone can use it: create your entire monitoring configuration with a few clicks due to our smart interface wirtten in PHP
5+
6+
# System requirements
7+
* Ubuntu 14.04 LTS x64
8+
* 2 CPU cores
9+
* 2 GB RAM
10+
* 15 GB space
11+
12+
### Production system sizing
13+
Unfortunately there is no golden rule for the right sizing of a monitoring system. This depends on the amount of hosts and services you like to monitor.
14+
15+
Please keep in mind that a monitoring system usually will create more I/O than your KVM farm!
16+
17+
A rough guide:
18+
* 32 GB RAM
19+
* 16 CPU Cores
20+
* 500GB space
21+
22+
# Installation
23+
openITCOCKPIT runs on Ubuntu systems and is available in the package manager apt.
24+
25+
To install openITCOCKPIT on your system, just run the following commands.
26+
27+
If [phpMyAdmin](https://www.phpmyadmin.net/) asks you for your web server **leave the selection blank** and continue with **Ok**.
28+
29+
openITCOCKPIT uses Nginx as webserver and will generate the configuration for phpMyAdmin automatically for you.
30+
````
31+
echo 'deb http://apt.open-itcockpit.com trusty main' > /etc/apt/sources.list.d/openitcockpit.list
32+
adv --recv --keyserver hkp://keyserver.ubuntu.com A7D3EAFA
33+
apt-get update
34+
apt-get install openitcockpit{,-nagios,-ndoutils,-npcd}
35+
/usr/share/openitcockpit/app/SETUP.sh
36+
````
37+
38+
# Features
39+
* Easy to use web interface
40+
* Template based configuration that will make your life easier
41+
* MySQL based
42+
* REST API
43+
* Inbuilt package manager everyone can provide Add-ons for extending the interface
44+
* HA cluster ready
45+
* Two-factor authentication
46+
* LDAP authentication
47+
* Multitenancy
48+
* Object permissions
49+
* [Distributed Monitoring](http://www.it-novum.com/blog/distributed-monitoring-mit-openitcockpit-phpnsta/)
50+
* [Mod-Gearman](http://mod-gearman.org/)
51+
* [Statusengine](http://statusengine.org/)
52+
* And much more to discover...
53+
54+
# Vagrant box [Repository](https://github.com/it-novum/vagrantboxes)
55+
If you like to try openITCOCKPIT you can install our Vagrant box
56+
* Install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads) on your system
57+
````
58+
apt-get install vagrant virtualbox
59+
````
60+
* Download the [Vagrantfile](https://raw.githubusercontent.com/it-novum/vagrantboxes/master/openITCOCKPIT_V3/Vagrantfile)
61+
````
62+
mkdir openITCOCKPIT_V3
63+
cd openITCOCKPIT_V3
64+
wget https://raw.githubusercontent.com/it-novum/vagrantboxes/master/openITCOCKPIT_V3/Vagrantfile
65+
````
66+
* Run the Vagrant box and follow the instructions
67+
````
68+
vagrant up
69+
````
70+
71+
# Developers welcome
72+
openITCOCKPIT's development is publicly available in GitHub. Everybody is welcomed to join :-)
73+
74+
### Vagrant box (nightly)
75+
Use [this Vagrantfile](https://raw.githubusercontent.com/it-novum/vagrantboxes/master/openITCOCKPIT_V3-nightly/Vagrantfile) to install the latest nightly build
76+
77+
# Need help or support?
78+
* Join [#openitcockpit](http://webchat.freenode.net/?channels=openitcockpit) on freenode.net
79+
* [Community forum](http://openitcockpit.org/forum.html)
80+
* [it-novum GmbH](http://www.it-novum.com/en/support-openitcockpit-en.html) provides commercial support
81+
82+
# License
83+
Copyright (C) <2015> <it-novum GmbH>
84+
85+
86+
openITCOCKPIT is dual licensed
87+
88+
89+
1)
90+
91+
This program is free software: you can redistribute it and/or modify
92+
it under the terms of the GNU General Public License as published by
93+
the Free Software Foundation, version 3 of the License.
94+
95+
96+
This program is distributed in the hope that it will be useful,
97+
but WITHOUT ANY WARRANTY; without even the implied warranty of
98+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
99+
GNU General Public License for more details.
100+
101+
102+
You should have received a copy of the GNU General Public License
103+
along with this program. If not, see <http://www.gnu.org/licenses/>.
104+
105+
106+
107+
2)
108+
If you purchased an openITCOCKPIT Enterprise Edition you can use this file
109+
under the terms of the openITCOCKPIT Enterprise Edition licence agreement.
110+
Licence agreement and licence key will be shipped with the order
111+
confirmation.
112+

app/.htaccess

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<IfModule mod_rewrite.c>
2+
RewriteEngine on
3+
RewriteRule ^$ webroot/ [L]
4+
RewriteRule (.*) webroot/$1 [L]
5+
</IfModule>
6+
<Files ~ "^\._">
7+
Order Allow,Deny
8+
Deny from all
9+
</Files>

app/API_Examples/Plain PHP/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This is an plain PHP API example. We cant recommand this way, because its a lot of work to make this thing work.
2+
Take a look a the example, that is using a PHP lib for the requests...

app/API_Examples/Plain PHP/cookie.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Netscape HTTP Cookie File
2+
# http://curl.haxx.se/docs/http-cookies.html
3+
# This file was generated by libcurl! Edit at your own risk.
4+
5+
#HttpOnly_172.16.2.44 FALSE / TRUE 1405355442 itnovum kg5p9m8r2qqfkl9uai4auechg5
6+
172.16.2.44 FALSE / FALSE 1406550642 CT[CTUser] Q2FrZQ%3D%3D.YZyjq8z8GhSS9vithtSq1PV4FgCA%2BfUSDbq3m9ikFUvuVClXYtKCLlvQoFP5
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#!/usr/bin/php
2+
<?php
3+
4+
$API = new oITCv3APIExamples();
5+
6+
$API->loadCommands();
7+
8+
$API->createCommand([
9+
'name' => 'API created',
10+
'command_line' => '$USER1$/check_api.php $ARG1$',
11+
'command_type' => 1
12+
]);
13+
14+
15+
16+
$API->close();
17+
18+
class oITCv3APIExamples{
19+
function __construct(){
20+
$this->server = "https://172.16.2.44";
21+
$this->username = "[email protected]";
22+
$this->password = "asdf12";
23+
$this->remember_me = 1;
24+
$this->_cookieFileLocation = dirname(__FILE__).'/cookie.txt';
25+
$this->verbose = true;
26+
$this->data = [];
27+
error_reporting(E_ALL);
28+
$this->_init($this->server);
29+
$this->_login();
30+
}
31+
32+
public function loadCommands(){
33+
$url = $this->_appendUrl('Commands/index/.json');
34+
$this->_sendRequest($url);
35+
print_r(json_decode($this->data));
36+
}
37+
38+
public function createCommand($fields){
39+
$url = $this->_appendUrl('Commands/add/');
40+
$query = '_method=POST&data[Command][name]='.$fields['name'].'&data[Command][command_line]='.$fields['command_line'].'&data[Command][command_type]='.$fields['command_type'];
41+
$this->_sendRequest($url, $query);
42+
}
43+
44+
private function _login(){
45+
$url = $this->_appendUrl('login/login');
46+
$fields = [
47+
'email' => rawurlencode($this->username),
48+
'password' => rawurlencode($this->password),
49+
'remember_me' => rawurlencode($this->remember_me)
50+
];
51+
52+
$query = '_method=POST&data[LoginUser][email]='.$fields['email'].'&data[LoginUser][password]='.$fields['password'].'&data[LoginUser][remember_me]='.$fields['remember_me'];
53+
54+
curl_setopt($this->ch, CURLOPT_POST, true);
55+
curl_setopt($this->ch, CURLOPT_POSTFIELDS, $query);
56+
57+
curl_setopt($this->ch, CURLOPT_URL, $url);
58+
$login = curl_exec($this->ch);
59+
$this->close();
60+
}
61+
62+
private function _init($url){
63+
$this->ch = curl_init();
64+
curl_setopt($this->ch, CURLOPT_URL, $url);
65+
curl_setopt($this->ch, CURLOPT_HEADER, 0);
66+
curl_setopt($this->ch, CURLOPT_TIMEOUT, 10);
67+
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
68+
curl_setopt($this->ch, CURLOPT_COOKIESESSION, true);
69+
curl_setopt($this->ch, CURLOPT_COOKIEJAR, $this->_cookieFileLocation);
70+
curl_setopt($this->ch, CURLOPT_COOKIEFILE, $this->_cookieFileLocation);
71+
curl_setopt($this->ch, CURLOPT_VERBOSE, $this->verbose);
72+
curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, false); //accept every SSL cert
73+
curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, false); //dont check host
74+
}
75+
76+
private function _appendUrl($url){
77+
return $this->server . '/' . $url;
78+
}
79+
80+
public function close(){
81+
curl_close($this->ch);
82+
}
83+
84+
private function _sendRequest($url, $query = ''){
85+
$this->_init($url);
86+
if($query !== ''){
87+
curl_setopt($this->ch, CURLOPT_POST, true);
88+
curl_setopt($this->ch, CURLOPT_POSTFIELDS, $query);
89+
}
90+
$this->data = curl_exec($this->ch);
91+
}
92+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Many thanks for the httpful lib :-)
2+
https://github.com/nategood/httpful
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/php
2+
<?php
3+
/*
4+
* This example shows you how to create, update and delete a command (CRUD)
5+
*/
6+
7+
require_once 'httpful/bootstrap.php';
8+
9+
//use Httpful\Request;
10+
login();
11+
function createCommand(){
12+
$url = "https://172.16.2.44/commands.json";
13+
$data = [
14+
'Command' => [
15+
'command_type' => 1, //Integer value (1,2,3)
16+
'name' => 'Command over API',
17+
'command_line' => '$USER1$/check_api',
18+
'description' => 'This command was created using the openITCOCKPIt API interface'
19+
]
20+
];
21+
22+
//If we use a post request, cake can do its macig, and runs the add method!!
23+
24+
$response = \Httpful\Request::get($url)
25+
->withoutStrictSSL()
26+
->useProxy('http://proxy.master.dns', '8080')
27+
->body(json_encode($data))
28+
->send();
29+
print_r($response);
30+
}
31+
32+
function login(){
33+
$url = "https://172.16.2.44/login/login.json";
34+
$data = [
35+
'LoginUser' => [
36+
'email' => '[email protected]',
37+
'password' => 'asdf12',
38+
'remember_me' => 0,
39+
]
40+
];
41+
42+
//If we use a post request, cake can do its macig, and runs the add method!!
43+
44+
$response = \Httpful\Request::get($url)
45+
->withoutStrictSSL()
46+
->useProxy('http://proxy.master.dns', '8080')
47+
->body(json_encode($data))
48+
->expectsJson()
49+
->send();
50+
print_r($response);
51+
}

0 commit comments

Comments
 (0)