Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ It is also possible to archive old tags. These are then not displayed in the gra

## Installation

To install the servcheck plugin, simply copy the plugin_servcheck directory to
To install the Tags plugin, simply copy the plugin_tags directory to
Cacti's plugins directory and rename it to simply 'tags'. Once you have done
this, goto Cacti's Plugin Management page, Install and Enable the Tags plugin. Once
this is complete, you can grant users permission to manage tags.
Expand All @@ -31,11 +31,11 @@ Go to Management -> Tags

## Bugs and Feature Enhancements

Bug and feature enhancements for the servcheck plugin are handled in GitHub. If
Bug and feature enhancements for the Tags plugin are handled in GitHub. If
you find a first search the Cacti forums for a solution before creating an issue
in GitHub - https://github.com/Cacti/plugin_tags

You can find more information on our forum - http://forums.cacti.net/
You can find more information on our forum - https://forums.cacti.net/viewtopic.php?t=64137

-----------------------------------------------
Copyright (c) 2004-2026 - The Cacti Group, Inc.
Expand Down
25 changes: 25 additions & 0 deletions images/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
| |
| This program is free software; you can redistribute it and/or |
| modify it under the terms of the GNU General Public License |
| as published by the Free Software Foundation; either version 2 |
| of the License, or (at your option) any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
+-------------------------------------------------------------------------+
| Cacti: The Complete RRDtool-based Graphing Solution |
+-------------------------------------------------------------------------+
| This code is designed, written, and maintained by the Cacti Group. See |
| about.php and/or the AUTHORS file for specific developer information. |
+-------------------------------------------------------------------------+
| http://www.cacti.net/ |
+-------------------------------------------------------------------------+
*/

header('Location: ../index.php');
35 changes: 17 additions & 18 deletions include/arrays.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
+-------------------------------------------------------------------------+
*/


$tags_retention = [
'0' => __('Never', 'tags'),
'7' => __('%d Days', 7, 'tags'),
Expand Down Expand Up @@ -52,16 +51,16 @@

$tags_auto_how = [
'primary' => __('Primary device', 'tags'),
'all' => __('All devices', 'tags'),
'all' => __('All devices', 'tags'),
];


$tags_event_types = [
'manual' => __('Manual', 'tags'),
'auto_device_added' => __('Device Added', 'tags'),
'auto_device_changed' => __('Device Changed', 'tags'),
'auto_device_restart' => __('Device Restart', 'tags'),
'auto_cacti_version_changed' => __('Cacti Version Changed', 'tags'),
'manual' => __('Manual', 'tags'),
'auto_device_added' => __('Device Added', 'tags'),
'auto_device_changed' => __('Device Changed', 'tags'),
'auto_device_restart' => __('Device Restart', 'tags'),
'auto_cacti_version_changed' => __('Cacti Version Changed', 'tags'),
'auto_other' => __('Other Automatic Events', 'tags'),
'auto_data_source_reindexed' => __('Data Source Reindexed', 'tags'),
'auto_poller_overrun' => __('Poller Overrun', 'tags'),
Expand Down Expand Up @@ -130,13 +129,13 @@
'none_value' => __('None', 'tags'),
],
'tag_time' => [
'method' => 'textbox',
'method' => 'textbox',
'friendly_name' => __('Date and time of tag', 'tags'),
'description' => __('The date / time for this tag.', 'tags'),
'value' => isset($data['tag_time']) ? date('Y-m-d H:i', $data['tag_time']) : '',
'default' => date('Y-m-d H:i', time()),
'max_length' => 22,
'size' => 22,
'description' => __('The date / time for this tag.', 'tags'),
'value' => isset($data['tag_time']) ? date('Y-m-d H:i', $data['tag_time']) : '',
'default' => date('Y-m-d H:i', time()),
'max_length' => 22,
'size' => 22,
],
'color' => [
'friendly_name' => __('Choose color', 'tags'),
Expand All @@ -160,16 +159,16 @@
];

$settings['tags'] = [
'tags_display_header1' => [
'tags_display_header1' => [
'friendly_name' => __('Settings', 'tags'),
'method' => 'spacer',
],
'tags_retention' => [
'friendly_name' => __('Data Retention', 'tags'),
'description' => __('After this time, tags will be moved to the archive and will no longer be displayed', 'mactrack'),
'method' => 'drop_array',
'default' => '365',
'array' => $tags_retention,
'description' => __('After this time, tags will be moved to the archive and will no longer be displayed', 'mactrack'),
'method' => 'drop_array',
'default' => '365',
'array' => $tags_retention,
],
'tags_graph_limit' => [
'friendly_name' => __('Graph legend limit', 'tags'),
Expand Down
22 changes: 3 additions & 19 deletions include/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,6 @@ function plugin_tags_upgrade() {
$new = $info['version'];
$old = db_fetch_cell('SELECT version FROM plugin_config WHERE directory="tags"');


if (version_compare($old, '0.2', '<')) {
/*
foreach (['plugin_tags_event', 'plugin_tags_event_archive'] as $table) {
$column = db_fetch_row("SHOW COLUMNS FROM $table LIKE 'type'");

if (isset($column['Type']) && stripos($column['Type'], 'varchar') !== 0) {
db_execute("ALTER TABLE $table MODIFY type varchar(32) NOT NULL DEFAULT 'manual'");
}

db_execute("UPDATE $table SET type = 'auto_other' WHERE type = 'automatic'");
}
*/
}

db_execute_prepared('UPDATE plugin_config SET version = ? WHERE directory = ?', [$new, 'tags']);

plugin_tags_setup_state_table();
Expand Down Expand Up @@ -97,13 +82,12 @@ function plugin_tags_setup_table() {
$data['comment'] = 'Events archive';
api_plugin_db_table_create('tags', 'plugin_tags_event_archive', $data);


$data = [];
$data = [];
$data['columns'][] = ['name' => 'host_id', 'type' => 'int(11)', 'NULL' => false];
$data['columns'][] = ['name' => 'uptime', 'type' => 'bigint(20)', 'NULL' => false, 'default' => '0'];
$data['primary'] = 'host_id';
$data['type'] = 'InnoDB';
$data['comment'] = 'Holds device uptime';
$data['type'] = 'InnoDB';
$data['comment'] = 'Holds device uptime';
api_plugin_db_table_create ('tags', 'plugin_tags_uptime', $data);

plugin_tags_setup_state_table();
Expand Down
Loading