GeezerVison is showing github.com — Update multiple plugins to latest stable UI · ddb4github/plugin_syslog@a6d66bd
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: config.php +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | <?php | 2 | 2 | /* | 3 | 3 | +-------------------------------------------------------------------------+ | 4 | | - | Copyright (C) 2007-2013 The Cacti Group | | | 4 | + | Copyright (C) 2007-2014 The Cacti Group | | 5 | 5 | | | | 6 | 6 | | This program is free software; you can redistribute it and/or | | 7 | 7 | | modify it under the terms of the GNU General Public License | | |
Collapse file Copy file name to clipboardExpand all lines: database.php +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | <?php | 2 | 2 | /* | 3 | 3 | +-------------------------------------------------------------------------+ | 4 | | - | Copyright (C) 2007-2013 The Cacti Group | | | 4 | + | Copyright (C) 2007-2014 The Cacti Group | | 5 | 5 | | | | 6 | 6 | | This program is free software; you can redistribute it and/or | | 7 | 7 | | modify it under the terms of the GNU General Public License | | |
Collapse file Copy file name to clipboardExpand all lines: functions.php +10-20Lines changed: 10 additions & 20 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 15 | 15 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | 16 | 16 | | GNU General Public License for more details. | | 17 | 17 | +-------------------------------------------------------------------------+ | 18 | | - | h.aloe: a syslog monitoring addon for Ian Berry's Cacti | | | 18 | + | h.aloe: a syslog monitoring addon for Ian Berry's Cacti | | 19 | 19 | +-------------------------------------------------------------------------+ | 20 | 20 | | Originally released as aloe by: sidewinder at shitworks.com | | 21 | 21 | | @@ -210,8 +210,11 @@ function syslog_remove_items($table, $uniqueID) { | 210 | 210 |
| 211 | 211 | include(dirname(__FILE__) . '/config.php'); | 212 | 212 |
| 213 | | - /* REMOVE ALL THE THINGS WE DONT WANT TO SEE */ | 214 | | - $rows = syslog_db_fetch_assoc("SELECT * FROM `" . $syslogdb_default . "`.`syslog_remove` WHERE enabled='on'"); | | 213 | + if ($table == 'syslog') { | | 214 | + $rows = syslog_db_fetch_assoc("SELECT * FROM `" . $syslogdb_default . "`.`syslog_remove` WHERE enabled='on' AND id=$uniqueID"); | | 215 | + }else{ | | 216 | + $rows = syslog_db_fetch_assoc("SELECT * FROM `" . $syslogdb_default . "`.`syslog_remove` WHERE enabled='on'"); | | 217 | + } | 215 | 218 |
| 216 | 219 | syslog_debug("Found " . sizeof($rows) . ", Removal Rule(s) to process"); | 217 | 220 |
| @@ -448,7 +451,7 @@ function syslog_remove_items($table, $uniqueID) { | 448 | 451 | $debugm = ''; | 449 | 452 | /* process the removal rule first */ | 450 | 453 | if ($sql1 != '') { | 451 | | - /* move rows first */ | | 454 | + /* now delete the remainder that match */ | 452 | 455 | syslog_db_execute($sql1); | 453 | 456 | } | 454 | 457 |
| @@ -457,8 +460,8 @@ function syslog_remove_items($table, $uniqueID) { | 457 | 460 | $removed += $syslog_cnn->Affected_Rows(); | 458 | 461 | $debugm = "Deleted " . $removed . ", "; | 459 | 462 | if ($sql1 != '') { | 460 | | - $debugm = "Moved " . $messages_moved . ", "; | 461 | 463 | $xferred += $syslog_cnn->Affected_Rows(); | | 464 | + $debugm = "Moved " . $xferred . ", "; | 462 | 465 | } | 463 | 466 |
| 464 | 467 | syslog_debug($debugm . " Message" . ($syslog_cnn->Affected_rows() == 1 ? "" : "s" ) . | @@ -631,7 +634,7 @@ function syslog_debug($message) { | 631 | 634 | } | 632 | 635 | } | 633 | 636 |
| 634 | | -function syslog_log_alert($alert_id, $alert_name, $severity, $msg, $count = 1, $html, $hosts) { | | 637 | +function syslog_log_alert($alert_id, $alert_name, $severity, $msg, $count = 1, $html) { | 635 | 638 | global $config, $severities; | 636 | 639 |
| 637 | 640 | include(dirname(__FILE__) . "/config.php"); | @@ -650,10 +653,6 @@ function syslog_log_alert($alert_id, $alert_name, $severity, $msg, $count = 1, $ | 650 | 653 |
| 651 | 654 | $id = 0; | 652 | 655 | $id = syslog_sql_save($save, "`" . $syslogdb_default . "`.`syslog_logs`", "seq"); | 653 | | - $save["seq"]=$id; | 654 | | - $save["alert_name"]= $alert_name; | 655 | | - //insert trigged record into grid_host_alarm | 656 | | - api_plugin_hook_function('syslog_update_hostsalarm', $save); | 657 | 656 |
| 658 | 657 | cacti_log("WARNING: The Syslog Alert '$alert_name' with Severity '" . $severities[$severity] . "', has been Triggered on Host '" . $msg["host"] . "', and Sequence '$id'", false, "SYSLOG"); | 659 | 658 |
| @@ -672,14 +671,6 @@ function syslog_log_alert($alert_id, $alert_name, $severity, $msg, $count = 1, $ | 672 | 671 |
| 673 | 672 | $id = 0; | 674 | 673 | $id = syslog_sql_save($save, "`" . $syslogdb_default . "`.`syslog_logs`", "seq"); | 675 | | - $save["seq"]=$id; | 676 | | - $save["alert_name"]=$alert_name; | 677 | | - | 678 | | - foreach($hosts as $host){ | 679 | | - | 680 | | - $save["host"] = $host; | 681 | | - api_plugin_hook_function('syslog_update_hostsalarm', $save); | 682 | | - } | 683 | 674 |
| 684 | 675 | cacti_log("WARNING: The Syslog Intance Alert '$alert_name' with Severity '" . $severities[$severity] . "', has been Triggered, Count was '" . $count . "', and Sequence '$id'", false, "SYSLOG"); | 685 | 676 |
| @@ -694,7 +685,6 @@ function syslog_manage_items($from_table, $to_table) { | 694 | 685 |
| 695 | 686 | /* Select filters to work on */ | 696 | 687 | $rows = syslog_db_fetch_assoc("SELECT * FROM `" . $syslogdb_default . "`.`syslog_remove` WHERE enabled='on'"); | 697 | | - //$rows = syslog_db_fetch_assoc("SELECT * FROM `" . $syslogdb_default . "`.`syslog_remove` WHERE enabled='on' AND message like 'last message repeated %'"); | 698 | 688 |
| 699 | 689 | syslog_debug("Found " . sizeof($rows) . ", Removal Rule(s)" . " to process"); | 700 | 690 |
| @@ -709,7 +699,7 @@ function syslog_manage_items($from_table, $to_table) { | 709 | 699 | $sql_sel = ""; | 710 | 700 | $sql_dlt = ""; | 711 | 701 |
| 712 | | - if ($remove['type'] == 'facility') { | | 702 | + if ($remove['type'] == 'facility') { | 713 | 703 | if ($remove['method'] != 'del') { | 714 | 704 | $sql_sel = "SELECT seq | 715 | 705 | FROM `" . $syslogdb_default . "`. $from_table | |
Collapse file Copy file name to clipboardExpand all lines: include/index.php -3Lines changed: 0 additions & 3 deletions Collapse file Copy file name to clipboardExpand all lines: include/top_syslog_header.php -135Lines changed: 0 additions & 135 deletions Collapse file Copy file name to clipboardExpand all lines: setup.php +11-7Lines changed: 11 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -817,7 +817,7 @@ function syslog_setup_table_new($options) { | 817 | 817 | function syslog_version () { | 818 | 818 | return array( | 819 | 819 | 'name' => 'syslog', | 820 | | - 'version' => '1.3', | | 820 | + 'version' => '1.4', | 821 | 821 | 'longname' => 'Syslog Monitoring', | 822 | 822 | 'author' => 'Jimmy Conner', | 823 | 823 | 'homepage' => 'http://cactiusers.org', | @@ -848,7 +848,7 @@ function syslog_poller_bottom() { | 848 | 848 | function syslog_install_advisor($syslog_exists, $db_version) { | 849 | 849 | global $config, $colors, $syslog_retentions; | 850 | 850 |
| 851 | | - include($config["include_path"] . "/top_header.php"); | | 851 | + top_header(); | 852 | 852 |
| 853 | 853 | syslog_config_arrays(); | 854 | 854 |
| @@ -916,7 +916,7 @@ function syslog_install_advisor($syslog_exists, $db_version) { | 916 | 916 |
| 917 | 917 | print "<table align='center' width='80%'><tr><td>\n"; | 918 | 918 | html_start_box("<strong>Syslog " . $type . " Advisor</strong>", "100%", $colors["header"], "3", "center", ""); | 919 | | - print "<tr><td bgcolor='#FFFFFF'>\n"; | | 919 | + print "<tr><td>\n"; | 920 | 920 | if ($syslog_exists) { | 921 | 921 | print "<h2 style='color:red;'>WARNING: Syslog Upgrade is Time Consuming!!!</h2>\n"; | 922 | 922 | print "<p>The upgrade of the 'main' syslog table can be a very time consuming process. As such, it is recommended | @@ -950,6 +950,8 @@ function syslog_install_advisor($syslog_exists, $db_version) { | 950 | 950 | html_end_box(); | 951 | 951 | syslog_confirm_button("install", "plugins.php", $syslog_exists); | 952 | 952 | print "</td></tr></table>\n"; | | 953 | + | | 954 | + bottom_footer(); | 953 | 955 | exit; | 954 | 956 | } | 955 | 957 |
| @@ -962,7 +964,7 @@ function syslog_uninstall_advisor() { | 962 | 964 |
| 963 | 965 | $syslog_exists = sizeof(syslog_db_fetch_row("SHOW TABLES FROM `" . $syslogdb_default . "` LIKE 'syslog'")); | 964 | 966 |
| 965 | | - include($config["include_path"] . "/top_header.php"); | | 967 | + top_header(); | 966 | 968 |
| 967 | 969 | $fields_syslog_update = array( | 968 | 970 | "uninstall_method" => array( | @@ -993,6 +995,8 @@ function syslog_uninstall_advisor() { | 993 | 995 | html_end_box(); | 994 | 996 | syslog_confirm_button("uninstall", "plugins.php", $syslog_exists); | 995 | 997 | print "</td></tr></table>\n"; | | 998 | + | | 999 | + bottom_footer(); | 996 | 1000 | exit; | 997 | 1001 | } | 998 | 1002 |
| @@ -1008,9 +1012,9 @@ function syslog_confirm_button($action, $cancel_url, $syslog_exists) { | 1008 | 1012 | } | 1009 | 1013 |
| 1010 | 1014 | ?> | 1011 | | - <table align='center' width='100%' style='background-color: #ffffff; border: 1px solid #bbbbbb;'> | | 1015 | + <table align='center' width='100%'> | 1012 | 1016 | <tr> | 1013 | | - <td bgcolor='#F5F5F5' align='right'> | | 1017 | + <td class='saveRow' align='right'> | 1014 | 1018 | <input name='<?php print ($syslog_exists ? 'return':'cancel')?>' type='submit' value='Cancel'> | 1015 | 1019 | <input name='<?php print $action;?>' type='submit' value='<?php print $value;?>'> | 1016 | 1020 | </td> | @@ -1499,7 +1503,7 @@ function syslog_utilities_list() { | 1499 | 1503 |
| 1500 | 1504 | html_header(array('Syslog Utilities'), 2); ?> | 1501 | 1505 |
| 1502 | | - <tr bgcolor='#<?php print $colors['form_alternate1'];?>'> | | 1506 | + <tr class='even'> | 1503 | 1507 | <td class='textArea'> | 1504 | 1508 | <a href='utilities.php?action=purge_syslog_hosts'>Purge Syslog Hosts</a> | 1505 | 1509 | </td> | |
Collapse file Copy file name to clipboardExpand all lines: syslog.css +16-8Lines changed: 16 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 5 | 5 |
| 6 | 6 | .table { | 7 | 7 | align:center; | 8 | | - border-color:#00438c; | 9 | | - border-style:solid; | 10 | | - border-width:2px; | 11 | 8 | width:100%; | 12 | 9 | } | 13 | 10 |
| | 11 | +.table tr th.th { | | 12 | + background: rgba(138,179,105,1); | | 13 | + background: -moz-linear-gradient(top, rgba(138,179,105,1) 0%, rgba(63,117,15,1) 100%); | | 14 | + background: -webkit-gradient(left top, left bottom, color-stop(0%, rgba(138,179,105,1)), color-stop(100%, rgba(63,117,15,1))); | | 15 | + background: -webkit-linear-gradient(top, rgba(138,179,105,1) 0%, rgba(63,117,15,1) 100%); | | 16 | + background: -o-linear-gradient(top, rgba(138,179,105,1) 0%, rgba(63,117,15,1) 100%); | | 17 | + background: -ms-linear-gradient(top, rgba(138,179,105,1) 0%, rgba(63,117,15,1) 100%); | | 18 | + background: linear-gradient(to bottom, rgba(138,179,105,1) 0%, rgba(63,117,15,1) 100%); | | 19 | + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#8ab369', endColorstr='#3f750f', GradientType=0 ); | | 20 | +} | | 21 | + | 14 | 22 | .th { | 15 | | - background-color:#00438c; | 16 | | - color:white; | 17 | | - font-family:Verdana,Arial,Helvetica,sans-serif; | 18 | | - text-align:left; | | 23 | + color: snow; | | 24 | + font-weight:bold; | | 25 | + vertical-align:bottom; | | 26 | + text-align:left; | 19 | 27 | } | 20 | 28 |
| 21 | 29 | .td { | | 34 | 42 | text-align:left; | 35 | 43 | font-family:Verdana,Arial,Helvetica,sans-serif; | 36 | 44 | font-size:12pt; | 37 | | -} | | 45 | +} |
|