Skip to content

Commit cb91106

Browse files
committed
Preparing for release 0.1 of Service Check Plugin
Still must do the translations using poedit.
1 parent 09961d0 commit cb91106

Some content is hidden

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

66 files changed

+23340
-10464
lines changed

CHANGELOG.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
* Initial public release - Based on plugin webseer version 3.2
66

7-
87
-----------------------------------------------
9-
Copyright (c) 2004-2023 - The Cacti Group, Inc.
8+
Copyright (c) 2004-2024 - The Cacti Group, Inc.
109

INFO

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; +-------------------------------------------------------------------------+
2-
; | Copyright (C) 2004-2023 The Cacti Group |
2+
; | Copyright (C) 2004-2024 The Cacti Group |
33
; | |
44
; | This program is free software; you can redistribute it and/or |
55
; | modify it under the terms of the GNU General Public License |

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,5 @@ in GitHub - https://github.com/Cacti/plugin_servcheck
7474
You can find more information on our forum - http://forums.cacti.net/viewtopic.php?t=62934
7575

7676
-----------------------------------------------
77-
Copyright (c) 2004-2023 - The Cacti Group, Inc.
77+
Copyright (c) 2004-2024 - The Cacti Group, Inc.
7878

includes/arrays.php

+265-271
Large diffs are not rendered by default.

includes/constants.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/*
33
+-------------------------------------------------------------------------+
4-
| Copyright (C) 2004-2023 The Cacti Group |
4+
| Copyright (C) 2004-2024 The Cacti Group |
55
| |
66
| This program is free software; you can redistribute it and/or |
77
| modify it under the terms of the GNU General Public License |

includes/functions.php

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/*
33
+-------------------------------------------------------------------------+
4-
| Copyright (C) 2004-2023 The Cacti Group |
4+
| Copyright (C) 2004-2024 The Cacti Group |
55
| |
66
| This program is free software; you can redistribute it and/or |
77
| modify it under the terms of the GNU General Public License |
@@ -25,7 +25,6 @@
2525
include_once(__DIR__ . '/constants.php');
2626
include_once(__DIR__ . '/arrays.php');
2727

28-
2928
function servcheck_show_tab($current_tab) {
3029
global $config;
3130

@@ -50,7 +49,7 @@ function servcheck_show_tab($current_tab) {
5049
}
5150
}
5251

53-
print "<div class='tabs'><nav><ul>\n";
52+
print "<div class='tabs'><nav><ul>";
5453

5554
if (cacti_sizeof($tabs)) {
5655
foreach ($tabs as $url => $name) {
@@ -84,6 +83,7 @@ function plugin_servcheck_remove_old_users () {
8483

8584
function plugin_servcheck_update_contacts() {
8685
$users = db_fetch_assoc("SELECT id, 'email' AS type, email_address FROM user_auth WHERE email_address!=''");
86+
8787
if (cacti_sizeof($users)) {
8888
foreach($users as $u) {
8989
$cid = db_fetch_cell('SELECT id FROM plugin_servcheck_contacts WHERE type="email" AND user_id=' . $u['id']);
@@ -110,6 +110,7 @@ function plugin_servcheck_check_debug() {
110110

111111
function plugin_servcheck_debug($message='') {
112112
global $debug;
113+
113114
if ($debug) {
114115
cacti_log('DEBUG: ' . trim($message), true, 'SERVCHECK');
115116
}
@@ -196,16 +197,14 @@ function plugin_servcheck_graph ($id, $interval) {
196197
$content .= 'line_' . $xid . ' = bb.generate(' . $chart_data . ');';
197198
$content .= '</script>';
198199

199-
echo $content;
200-
200+
print $content;
201201
}
202202

203203
// I know, it not secure, it is better than plaintext
204204

205205
function servcheck_hide_text ($string) {
206-
207206
$output = '';
208-
207+
209208
for ($f = 0; $f < strlen($string); $f++) {
210209
$output .= dechex(ord($string[$f]));
211210
}
@@ -214,9 +213,8 @@ function servcheck_hide_text ($string) {
214213
}
215214

216215
function servcheck_show_text ($string) {
217-
218216
$output = '';
219-
217+
220218
for ($f = 0; $f < strlen($string); $f = $f + 2) {
221219
$output .= chr(hexdec($string[$f] . $string[($f+1)]));
222220
}

includes/index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/*
33
+-------------------------------------------------------------------------+
4-
| Copyright (C) 2004-2023 The Cacti Group |
4+
| Copyright (C) 2004-2024 The Cacti Group |
55
| |
66
| This program is free software; you can redistribute it and/or |
77
| modify it under the terms of the GNU General Public License |

includes/mxlookup.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/*
33
+-------------------------------------------------------------------------+
4-
| Copyright (C) 2004-2023 The Cacti Group |
4+
| Copyright (C) 2004-2024 The Cacti Group |
55
| |
66
| This program is free software; you can redistribute it and/or |
77
| modify it under the terms of the GNU General Public License |
@@ -127,7 +127,7 @@ function QNAME($domain) {
127127
function gord($ln = 1) {
128128
$reply = '';
129129

130-
for($i = 0; $i < $ln; $i++){
130+
for($i = 0; $i < $ln; $i++) {
131131
$reply .= ord(substr($this->dns_reply, $this->cIx, 1));
132132
$this->cIx++;
133133
}

includes/tests.php

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/*
33
+-------------------------------------------------------------------------+
4-
| Copyright (C) 2004-2023 The Cacti Group |
4+
| Copyright (C) 2004-2024 The Cacti Group |
55
| |
66
| This program is free software; you can redistribute it and/or |
77
| modify it under the terms of the GNU General Public License |
@@ -22,7 +22,6 @@
2222
+-------------------------------------------------------------------------+
2323
*/
2424

25-
2625
$user_agent = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1';
2726
$ca_info = $config['base_path'] . '/plugins/servcheck/ca-bundle.crt';
2827

@@ -112,7 +111,7 @@ function curl_try ($test) {
112111

113112
$process = curl_init($url);
114113

115-
if($test['ca'] > 0) {
114+
if ($test['ca'] > 0) {
116115
$ca_info = '/tmp/cert' . $test['ca'] . '.pem';
117116
plugin_servcheck_debug('Preparing own CA chain file ' . $ca_info , $test);
118117

@@ -177,10 +176,10 @@ function curl_try ($test) {
177176

178177
// Disable Cert checking for now
179178
if ($test['checkcert'] == '') {
180-
$options[CURLOPT_SSL_VERIFYPEER] = FALSE;
181-
$options[CURLOPT_SSL_VERIFYHOST] = FALSE;
179+
$options[CURLOPT_SSL_VERIFYPEER] = false;
180+
$options[CURLOPT_SSL_VERIFYHOST] = false;
182181
} else { // for sure, it seems that it isn't enabled by default now
183-
$options[CURLOPT_SSL_VERIFYPEER] = TRUE;
182+
$options[CURLOPT_SSL_VERIFYPEER] = true;
184183
$options[CURLOPT_SSL_VERIFYHOST] = 2;
185184
}
186185

@@ -213,7 +212,7 @@ function curl_try ($test) {
213212
$results['error'] = str_replace(array('"', "'"), '', (curl_error($process)));
214213
}
215214

216-
if($test['ca'] > 0) {
215+
if ($test['ca'] > 0) {
217216
unlink ($ca_info);
218217
plugin_servcheck_debug('Removing own CA file');
219218
}
@@ -266,7 +265,7 @@ function curl_try ($test) {
266265

267266
plugin_servcheck_debug('Processing search maint');
268267

269-
if(strpos($data, $test['search_maint']) !== false) {
268+
if (strpos($data, $test['search_maint']) !== false) {
270269
plugin_servcheck_debug('Search maint string success');
271270
$results['result_search'] = 'maint ok';
272271
return $results;
@@ -312,6 +311,7 @@ function dns_try ($test) {
312311

313312
$a = new mxlookup($test['dns_query'], $test['hostname']);
314313
$t = microtime(true) - $s;
314+
315315
$results['options']['connect_time'] = $results['options']['total_time'] = $results['options']['namelookup_time'] = round($t, 4);
316316

317317
$results['data'] = '';
@@ -324,7 +324,6 @@ function dns_try ($test) {
324324

325325
// If we have set a failed search string, then ignore the normal searches and only alert on it
326326
if ($test['search_failed'] != '') {
327-
328327
plugin_servcheck_debug('Processing search_failed');
329328

330329
if (strpos($results['data'], $test['search_failed']) !== false) {
@@ -348,10 +347,9 @@ function dns_try ($test) {
348347
}
349348

350349
if ($test['search_maint'] != '') {
351-
352350
plugin_servcheck_debug('Processing search maint');
353351

354-
if(strpos($results['data'], $test['search_maint']) !== false) {
352+
if (strpos($results['data'], $test['search_maint']) !== false) {
355353
plugin_servcheck_debug('Search maint string success');
356354
$results['result_search'] = 'maint ok';
357355
return $results;

index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/*
33
+-------------------------------------------------------------------------+
4-
| Copyright (C) 2004-2023 The Cacti Group |
4+
| Copyright (C) 2004-2024 The Cacti Group |
55
| |
66
| This program is free software; you can redistribute it and/or |
77
| modify it under the terms of the GNU General Public License |

locales/LC_MESSAGES/ar-SA.mo

-405 Bytes
Binary file not shown.

locales/LC_MESSAGES/bg-BG.mo

-793 Bytes
Binary file not shown.

locales/LC_MESSAGES/de-DE.mo

-683 Bytes
Binary file not shown.

locales/LC_MESSAGES/el-GR.mo

-533 Bytes
Binary file not shown.

locales/LC_MESSAGES/es-ES.mo

-784 Bytes
Binary file not shown.

locales/LC_MESSAGES/fr-FR.mo

-883 Bytes
Binary file not shown.

locales/LC_MESSAGES/he-IL.mo

-554 Bytes
Binary file not shown.

locales/LC_MESSAGES/hi-IN.mo

-476 Bytes
Binary file not shown.

locales/LC_MESSAGES/index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/*
33
+-------------------------------------------------------------------------+
4-
| Copyright (C) 2004-2023 The Cacti Group |
4+
| Copyright (C) 2004-2024 The Cacti Group |
55
| |
66
| This program is free software; you can redistribute it and/or |
77
| modify it under the terms of the GNU General Public License |

locales/LC_MESSAGES/it-IT.mo

-711 Bytes
Binary file not shown.

locales/LC_MESSAGES/ja-JP.mo

-639 Bytes
Binary file not shown.

locales/LC_MESSAGES/ko-KR.mo

-663 Bytes
Binary file not shown.

locales/LC_MESSAGES/lv-LV.mo

-9.12 KB
Binary file not shown.

locales/LC_MESSAGES/nl-NL.mo

-676 Bytes
Binary file not shown.

locales/LC_MESSAGES/pl-PL.mo

-684 Bytes
Binary file not shown.

locales/LC_MESSAGES/pt-BR.mo

-511 Bytes
Binary file not shown.

locales/LC_MESSAGES/pt-PT.mo

-523 Bytes
Binary file not shown.

locales/LC_MESSAGES/ru-RU.mo

-1.07 KB
Binary file not shown.

locales/LC_MESSAGES/sv-SE.mo

-386 Bytes
Binary file not shown.

locales/LC_MESSAGES/tr-TR.mo

-624 Bytes
Binary file not shown.

locales/LC_MESSAGES/vi-VN.mo

-654 Bytes
Binary file not shown.

locales/LC_MESSAGES/zh-CN.mo

-4.68 KB
Binary file not shown.

locales/LC_MESSAGES/zh-TW.mo

-584 Bytes
Binary file not shown.

locales/index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/*
33
+-------------------------------------------------------------------------+
4-
| Copyright (C) 2004-2023 The Cacti Group |
4+
| Copyright (C) 2004-2024 The Cacti Group |
55
| |
66
| This program is free software; you can redistribute it and/or |
77
| modify it under the terms of the GNU General Public License |

0 commit comments

Comments
 (0)