forked from Cacti/plugin_thold
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.php
More file actions
839 lines (780 loc) · 37 KB
/
settings.php
File metadata and controls
839 lines (780 loc) · 37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
<?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2025 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/ |
+-------------------------------------------------------------------------+
*/
function thold_draw_navigation_text($nav) {
global $config;
$nav['thold.php:'] = array(
'title' => __('Thresholds', 'thold'),
'mapping' => 'index.php:',
'url' => 'thold.php',
'level' => '1'
);
$nav['thold.php:actions'] = array(
'title' => __('(actions)', 'thold'),
'mapping' => 'index.php:,thold.php:',
'url' => 'thold.php',
'level' => '2'
);
$nav['thold.php:edit'] = array(
'title' => __('(edit)', 'thold'),
'mapping' => 'index.php:,thold.php:',
'url' => 'thold.php',
'level' => '2'
);
$nav['thold.php:save'] = array(
'title' => __('(save)', 'thold'),
'mapping' => 'index.php:,thold.php:',
'url' => 'thold.php',
'level' => '2'
);
$nav['thold.php:add'] = array(
'title' => __('(add)', 'thold'),
'mapping' => 'index.php:,thold.php:',
'url' => 'thold.php',
'level' => '2'
);
$nav['thold.php:autocreate'] = array(
'title' => __('Thresholds', 'thold'),
'mapping' => 'index.php:',
'url' => 'thold.php',
'level' => '2'
);
$nav['thold_graph.php:'] = array(
'title' => __('Thresholds', 'thold'),
'mapping' => '',
'url' => 'thold_graph.php',
'level' => '0'
);
$nav['thold_graph.php:thold'] = array(
'title' => __('Thresholds', 'thold'),
'mapping' => '',
'url' => 'thold_graph.php',
'level' => '0'
);
$nav['thold_graph.php:log'] = array(
'title' => __('Threshold Logs', 'thold'),
'mapping' => '',
'url' => 'thold_graph.php',
'level' => '0'
);
$nav['thold_graph.php:hoststat'] = array(
'title' => __('Device Status', 'thold'),
'mapping' => '',
'url' => 'thold_graph.php',
'level' => '0'
);
$nav['thold_view_failures.php:'] = array(
'title' => __('Thresholds - Failures', 'thold'),
'mapping' => 'index.php:',
'url' => 'thold_view_failures.php',
'level' => '1'
);
$nav['thold_view_normal.php:'] = array(
'title' => __('Thresholds - Normal', 'thold'),
'mapping' => 'index.php:',
'url' => 'thold_view_normal.php',
'level' => '1'
);
$nav['thold_view_recover.php:'] = array(
'title' => __('Thresholds - Recovering', 'thold'),
'mapping' => 'index.php:',
'url' => 'thold_view_recover.php',
'level' => '1'
);
$nav['thold_view_recent.php:'] = array(
'title' => __('Recent Thresholds', 'thold'),
'mapping' => 'index.php:',
'url' => 'thold_view_recent.php',
'level' => '1'
);
$nav['thold_view_host.php:'] = array(
'title' => __('Recent Device Failures', 'thold'),
'mapping' => 'index.php:',
'url' => 'thold_view_host.php',
'level' => '1'
);
$nav['thold_templates.php:'] = array(
'title' => __('Threshold Templates', 'thold'),
'mapping' => 'index.php:',
'url' => 'thold_templates.php',
'level' => '1'
);
$nav['thold_templates.php:edit'] = array(
'title' => __('Threshold Templates', 'thold'),
'mapping' => 'index.php:',
'url' => 'thold_templates.php',
'level' => '1'
);
$nav['thold_templates.php:save'] = array(
'title' => __('Threshold Templates', 'thold'),
'mapping' => 'index.php:',
'url' => 'thold_templates.php',
'level' => '1'
);
$nav['thold_templates.php:add'] = array(
'title' => __('Threshold Templates', 'thold'),
'mapping' => 'index.php:',
'url' => 'thold_templates.php',
'level' => '1'
);
$nav['thold_templates.php:actions'] = array(
'title' => __('Threshold Templates', 'thold'),
'mapping' => 'index.php:',
'url' => 'thold_templates.php',
'level' => '1'
);
$nav['thold_templates.php:import'] = array(
'title' => __('Threshold Template Import', 'thold'),
'mapping' => 'index.php:',
'url' => 'thold_templates.php',
'level' => '2'
);
$nav['notify_lists.php:'] = array(
'title' => __('Notification Lists', 'thold'),
'mapping' => 'index.php:',
'url' => 'notify_lists.php',
'level' => '1'
);
$nav['notify_lists.php:edit'] = array(
'title' => __('Notification Lists (edit)', 'thold'),
'mapping' => 'index.php:',
'url' => 'notify_lists.php',
'level' => '1'
);
$nav['notify_lists.php:save'] = array(
'title' => __('Notification Lists', 'thold'),
'mapping' => 'index.php:',
'url' => 'notify_lists.php',
'level' => '1'
);
$nav['notify_lists.php:actions'] = array(
'title' => __('Notification Lists', 'thold'),
'mapping' => 'index.php:',
'url' => 'notify_lists.php',
'level' => '1'
);
$nav['notify_queue.php:'] = array(
'title' => __('Notification Queue', 'thold'),
'mapping' => 'index.php:',
'url' => 'notify_queue.php',
'level' => '1'
);
$nav['notify_queue.php:actions'] = array(
'title' => __('Notification Queue', 'thold'),
'mapping' => 'index.php:',
'url' => 'notify_queue.php',
'level' => '1'
);
return $nav;
}
function thold_config_insert() {
global $menu;
$menu[__('Management')]['plugins/thold/notify_lists.php'] = __('Notification Lists', 'thold');
$menu[__('Management')]['plugins/thold/notify_queue.php'] = __('Notification Queue', 'thold');
$menu[__('Management')]['plugins/thold/thold.php'] = __('Thresholds', 'thold');
$menu[__('Templates')]['plugins/thold/thold_templates.php'] = __('Threshold', 'thold');
if (isset_request_var('thold_vrule')) {
if (get_nfilter_request_var('thold_vrule') == 'on') {
$_SESSION['sess_config_array']['thold_draw_vrules'] = 'on';
$_SESSION['sess_config_array']['boost_png_cache_enable'] = false;
} elseif (get_nfilter_request_var('thold_vrule') == '') {
$_SESSION['sess_config_array']['thold_draw_vrules'] = '';
}
}
if (!defined('ST_RESTORAL')) {
define('ST_RESTORAL', 0); // Restoral
define('ST_TRIGGERA', 1); // Trigger Alert
define('ST_NOTIFYRA', 2); // Notify Alert Retrigger
define('ST_NOTIFYWA', 3); // Notify Warning
define('ST_NOTIFYAL', 4); // Notify Alert
define('ST_NOTIFYRS', 5); // Notify Restoral
define('ST_TRIGGERW', 6); // Trigger Warning
define('ST_NOTIFYAW', 7); // Notify Restoral to Warning
define('ST_NOTIFYRAW', 8); // Notify Warning Retrigger
}
if (!defined('MESSAGE_LEVEL_NONE')) {
define('MESSAGE_LEVEL_NONE', 0);
define('MESSAGE_LEVEL_INFO', 1);
define('MESSAGE_LEVEL_WARN', 2);
define('MESSAGE_LEVEL_ERROR', 3);
define('MESSAGE_LEVEL_CSRF', 4);
}
if (!defined('STAT_HI')) {
define('STAT_HI', 2);
define('STAT_LO', 1);
define('STAT_NORMAL', 0);
}
if (!defined('THOLD_SEVERITY_NORMAL')) {
define('THOLD_SEVERITY_NORMAL', 0);
define('THOLD_SEVERITY_ALERT', 1);
define('THOLD_SEVERITY_WARNING', 2);
define('THOLD_SEVERITY_NOTICE', 3);
define('THOLD_SEVERITY_ACKREQ', 4);
define('THOLD_SEVERITY_DISABLED', 5);
define('THOLD_SEVERITY_BASELINE', 6);
}
}
function thold_config_arrays() {
global $config, $messages, $device_change_fields;
$messages['thold_save'] = array(
'message' => __('A template with that Data Source already exists!', 'thold'),
'type' => 'error'
);
if (isset($_SESSION['thold_message']) && $_SESSION['thold_message'] != '') {
$messages['thold_message'] = array(
'message' => $_SESSION['thold_message'],
'type' => 'info'
);
}
$device_change_fields['match_field'][] = 'thold_send_email';
$device_change_fields['match_field'][] = 'thold_host_email';
$device_change_fields['match_field'][] = 'thold_failure_count';
$realm_array = array(
__('Configure Thresholds', 'thold'),
__('Configure Threshold Templates', 'thold'),
__('Manage Notification Lists', 'thold'),
__('View Thresholds', 'thold')
);
if (function_exists('auth_augment_roles')) {
auth_augment_roles(__('Normal User'), array('thold_graph.php'));
auth_augment_roles(__('Template Editor'), array('thold_templates.php'));
auth_augment_roles(__('General Administration'), array('thold.php'));
auth_augment_roles(__('General Administration'), array('notify_lists.php','notify_queue.php'));
}
kill_session_var('thold_message');
}
function thold_config_form() {
global $fields_host_edit;
$fields_host_edit2 = $fields_host_edit;
$fields_host_edit3 = array();
if (array_key_exists('bulk_walk_size', $fields_host_edit2)) {
$insert_field = 'bulk_walk_size';
} else {
$insert_field = 'disabled';
}
foreach ($fields_host_edit2 as $f => $a) {
$fields_host_edit3[$f] = $a;
if ($f == $insert_field) {
$fields_host_edit3['thold_mail_spacer'] = array(
'friendly_name' => __('Device Up/Down Notification Settings', 'thold'),
'method' => 'spacer',
'collapsible' => true
);
$fields_host_edit3['thold_send_email'] = array(
'friendly_name' => __('Threshold Up/Down Email Notification', 'thold'),
'method' => 'drop_array',
'array' => array(
'0' => __('Disabled', 'thold'),
'1' => __('Global List', 'thold'),
'2' => __('List Below', 'thold'),
'3' => __('Global and List Below', 'thold')
),
'description' => __('Which Type of Notification List(s) should be used for Device Up/Down events?', 'thold'),
'value' => '|arg1:thold_send_email|',
'on_change' => 'changeNotify()',
'default' => '1',
'form_id' => false
);
$fields_host_edit3['thold_host_email'] = array(
'friendly_name' => __('Notification List', 'thold'),
'description' => __('Which Notification List(s) of should be notified about Device Up/Down events?', 'thold'),
'method' => 'drop_sql',
'sql' => 'SELECT id,name FROM plugin_notification_lists ORDER BY name',
'value' => '|arg1:thold_host_email|',
'default' => '',
'none_value' => 'None'
);
$fields_host_edit3['thold_failure_count'] = array(
'friendly_name' => __('Host Failure Count', 'thold'),
'description' => __('The number of Polling Intervals at this Host must be Down before Thold logging an error and reporting Host as Down. Default is 0 (use Cacti setting)', 'thold'),
'method' => 'drop_array',
'value' => '|arg1:thold_failure_count|',
'default' => '0',
'array' => array(
0 => __('Use Cacti Setting', 'thold'),
1 => __('%d Polling Interval', 1, 'thold'),
2 => __('%d Polling Intervals', 2, 'thold'),
3 => __('%d Polling Intervals', 3, 'thold'),
4 => __('%d Polling Intervals', 4, 'thold'),
5 => __('%d Polling Intervals', 5, 'thold')
)
);
}
}
$fields_host_edit = $fields_host_edit3;
}
function thold_config_settings() {
global $tabs, $settings, $item_rows, $config, $syslog_facil_array, $syslog_priority_array;
if (get_current_page() != 'settings.php') return;
include($config['base_path'] . '/plugins/thold/includes/arrays.php');
include_once($config['base_path'] . '/plugins/thold/setup.php');
include_once($config['base_path'] . '/plugins/thold/thold_functions.php');
include_once($config['base_path'] . '/plugins/thold/includes/database.php');
/* check to see if there is an upgrade required */
plugin_thold_upgrade();
$tabs['alerts'] = __('Alerting/Thold', 'thold');
if (isset($settings['alerts'])) {
$temp = $settings['alerts'];
}
$settings['alerts'] = array(
'general_header' => array(
'friendly_name' => __('General', 'thold'),
'method' => 'spacer',
),
'thold_disable_all' => array(
'friendly_name' => __('Disable All Thresholds', 'thold'),
'description' => __('Checking this box will disable Alerting on all Thresholds. This can be used when it is necessary to perform maintenance on your network.', 'thold'),
'method' => 'checkbox',
'default' => ''
),
'thold_autocreate' => array(
'friendly_name' => __('Auto Create Thresholds', 'thold'),
'description' => __('If selected, when running either automation, or when creating/saving a Device, all Thresholds associated with the Device Template will be created.', 'thold'),
'method' => 'checkbox',
'default' => ''
),
'thold_consider_unknown_zero' => array(
'friendly_name' => __('Consider Unknown Data as Zero', 'thold'),
'description' => __('When checking Thresholds, if a Data Source returns Unknown Data (\'U\'), consider the value as zero for the Threshold check. You can also enable log this issue.', 'thold'),
'method' => 'checkbox',
'default' => ''
),
'thold_filter_default' => array(
'friendly_name' => __('Default Management Status', 'thold'),
'description' => __('Default Threshold management filter status.', 'thold'),
'method' => 'drop_array',
'array' => array(
'-1' => __('Any', 'thold'),
'0' => __('Breached or Triggered', 'thold'),
'1' => __('Breached', 'thold'),
'3' => __('Triggered', 'thold'),
'6' => __('Disabled', 'thold'),
'2' => __('Enabled', 'thold'),
),
'default' => -1
),
'thold_empty_if_speed_default' => array(
'friendly_name' => __('Empty ifHighSpeed Default', 'thold'),
'description' => __('When calculating Expression Thresholds, if the ifHighSpeed and ifSpeed come back as zero, use the following ifHighSpeed setting instead. Default ifHighSpeed will be 10000 for 10GE interfaces.', 'thold'),
'method' => 'textbox',
'size' => 6,
'max_length' => 6,
'default' => '10000'
),
'notification_header' => array(
'friendly_name' => __('Notification Preferences', 'thold'),
'method' => 'spacer',
),
'thold_disable_legacy' => array(
'friendly_name' => __('Disable Legacy Notifications', 'thold'),
'description' => __('Checking this box will disable Legacy Alerting on all Thresholds. Legacy Alerting is defined as any Specific Email Alerts not associated with a Notification List.', 'thold'),
'method' => 'checkbox',
'default' => ''
),
'notify_templated' => array(
'friendly_name' => __('Threshold Notification Templated', 'thold'),
'description' => __('If checked, when creating at Threshold Template, its Notification Settings will, by default be owned by the Threshold Template.', 'thold'),
'method' => 'checkbox'
),
'thold_enable_scripts' => array(
'friendly_name' => __('Enable Command Execution', 'thold'),
'description' => __('Checking this box will enable the ability to run commands on Threshold breach and restoral events.', 'thold'),
'method' => 'checkbox',
'default' => ''
),
'thold_enable_per_thold_body' => array(
'friendly_name' => __('Enable Per Thold Notification', 'thold'),
'description' => __('Checking this box will enable the ability to maintain custom Email bodies for Thresholds.', 'thold'),
'method' => 'checkbox',
'default' => ''
),
'thold_notification_queue' => array(
'friendly_name' => __('Enable Notification Queue', 'thold'),
'description' => __('Checking this box will switch Thold from performing inline Notification to using either the Notification Daemon, or notifications performed out of band by the Notification poller.', 'thold'),
'method' => 'checkbox',
'default' => ''
),
'thold_notify_alerts_to_warning_recipients' => array(
'friendly_name' => __('Enable Sending Alert Emails to Warning Notification Lists', 'thold'),
'description' => __('Check this box if you wish Warning Notification List recipients to receive Alert Emails in addition to the Alert Notification list receivers. This case is applicable when Warning Notifications goes to Administrators and Alert Notifications go to Management.', 'thold'),
'method' => 'checkbox',
'default' => ''
),
'daemon_header' => array(
'friendly_name' => __('Threshold Daemon', 'thold'),
'method' => 'spacer',
),
'thold_daemon_enable' => array(
'friendly_name' => __('Enable Threshold Daemon', 'thold'),
'description' => __('Checking this box will enable the use of a dedicated Threshold daemon. This can be used to increase system performance and/or to distribute Threshold monitoring to a separate server.', 'thold'),
'method' => 'checkbox',
'default' => ''
),
'thold_daemon_debug' => array(
'friendly_name' => __('Force Threshold Daemon Debug', 'thold'),
'description' => __('Checking this box will enable Threshold Daemon debug when operating from SystemD or through the command line. This change is dynamic and will take effect as soon as the next Threshold loop commences.', 'thold'),
'method' => 'checkbox',
'default' => ''
),
'thold_daemon_dead_notification' => array(
'friendly_name' => __('Daemon Down Notification Frequency', 'thold'),
'description' => __('If the Thold Daemon is found to be down, send out an Email notification at this frequency.', 'thold'),
'method' => 'drop_array',
'array' => array(
'-1' => __('Disabled', 'thold'),
'600' => __('Every %d Minutes', 10, 'thold'),
'1200' => __('Every %d Minutes', 20, 'thold'),
'2400' => __('Every %d Minutes', 40, 'thold'),
'3600' => __('Every %d Hour', 1, 'thold'),
'7200' => __('Every %d Hours', 2, 'thold')
),
'default' => 7200
),
'thold_max_concurrent_processes' => array(
'friendly_name' => __('Daemon Threads', 'thold'),
'description' => __('The number of daemon threads to be handled by the Threshold Daemon.', 'thold'),
'method' => 'drop_array',
'array' => array(
'1' => __('1 Process', 'thold'),
'2' => __('%d Processes', 2, 'thold'),
'3' => __('%d Processes', 3, 'thold'),
'4' => __('%d Processes', 4, 'thold'),
'5' => __('%d Processes', 5, 'thold'),
'6' => __('%d Processes', 6, 'thold'),
'7' => __('%d Processes', 7, 'thold'),
'8' => __('%d Processes', 8, 'thold'),
'9' => __('%d Processes', 9, 'thold'),
'10' => __('%d Processes', 10, 'thold')
),
'default' => read_config_option('concurrent_processes')
),
'logging_header' => array(
'friendly_name' => __('Logging', 'thold'),
'method' => 'spacer',
),
'thold_log_cacti' => array(
'friendly_name' => __('Log Threshold Breaches', 'thold'),
'description' => __('Enable logging of all Threshold failures to the Cacti Log.', 'thold'),
'method' => 'checkbox',
'default' => ''
),
'thold_show_datasource' => array(
'friendly_name' => __('Show Data Source in Log', 'thold'),
'description' => __('Show the Data Source name in the Log if not present.', 'thold'),
'method' => 'checkbox',
'default' => ''
),
'thold_log_changes' => array(
'friendly_name' => __('Log Threshold Changes', 'thold'),
'description' => __('Enable logging of all Threshold changes to the Cacti Log.', 'thold'),
'method' => 'checkbox',
'default' => ''
),
'thold_log_debug' => array(
'friendly_name' => __('Debug Log', 'thold'),
'description' => __('Enable logging of debug messages with Threshold', 'thold'),
'method' => 'checkbox',
'default' => ''
),
'thold_log_storage' => array(
'friendly_name' => __('Alert Log Retention', 'thold'),
'description' => __('Keep Threshold Logs for this number of days.', 'thold'),
'method' => 'drop_array',
'default' => '31',
'array' => $thold_log_retention
),
'thold_log_unknown_to_zero' => array(
'friendly_name' => __('Log action Consider Unknown Data as Zero', 'thold'),
'description' => __('When \'Consider Unknown Data as Zero\' is enabled, log when it occurs', 'thold'),
'method' => 'checkbox',
'default' => ''
),
'syslog_header' => array(
'friendly_name' => __('Syslog Settings', 'thold'),
'method' => 'spacer',
),
'alert_syslog' => array(
'friendly_name' => __('Syslog Enabled', 'thold'),
'description' => __('If checked, when creating a new Threshold, by default new Threshold events will be sent to your local syslog. This setting is a preset. Threshold settings dictate actual syslog control.', 'thold'),
'method' => 'checkbox'
),
'thold_syslog_priority' => array(
'friendly_name' => __('Default Priority/Level', 'thold'),
'description' => __('This is the default Priority/Level that Thold will use to send syslog messages. This setting is a preset. Threshold settings dictate actual syslog control.', 'thold'),
'method' => 'drop_array',
'default' => $default_priority,
'array' => $syslog_priority_array,
),
'thold_syslog_facility' => array(
'friendly_name' => __('Default Facility', 'thold'),
'description' => __('This is the default Facility that Thold will use to send syslog messages. This setting is a preset. Threshold settings dictate actual syslog control.', 'thold'),
'method' => 'drop_array',
'default' => $default_facility,
'array' => $syslog_facil_array,
),
'thold_alerting_header' => array(
'friendly_name' => __('Alert Presets', 'thold'),
'method' => 'spacer',
),
'alert_exempt' => array(
'friendly_name' => __('Weekend exemptions', 'thold'),
'description' => __('If this is checked, Thold will not run on weekends.', 'thold'),
'method' => 'checkbox',
),
'alert_trigger' => array(
'friendly_name' => __('Default Trigger Count', 'thold'),
'description' => __('Default number of consecutive times the Data Source must be in breach of the Threshold for an Alert to be raised.', 'thold'),
'method' => 'textbox',
'size' => 4,
'max_length' => 4,
'default' => 1
),
'alert_repeat' => array(
'friendly_name' => __('Re-Alerting', 'thold'),
'description' => __('Repeat Alert after specified number of poller cycles.', 'thold'),
'method' => 'textbox',
'size' => 4,
'max_length' => 4,
'default' => 12
),
'thold_baseline_header' => array(
'friendly_name' => __('Baseline Presets', 'thold'),
'method' => 'spacer',
),
'alert_bl_timerange_def' => array(
'friendly_name' => __('Baseline Time Range Default', 'thold'),
'description' => __('This is the default value used in creating Thresholds or templates.', 'thold'),
'method' => 'drop_array',
'array' => get_reference_types(),
'size' => 12,
'max_length' => 12,
'default' => 86400
),
'alert_bl_trigger' => array(
'friendly_name' => __('Baseline Trigger Count', 'thold'),
'description' => __('Default number of consecutive times the Data Source must be in breach of the calculated Baseline Threshold for an Alert to be raised.', 'thold'),
'method' => 'textbox',
'size' => 4,
'max_length' => 4,
'default' => 2
),
'alert_bl_percent_def' => array(
'friendly_name' => __('Baseline Deviation Percentage', 'thold'),
'description' => __('This is the default value used in creating Thresholds or templates.', 'thold'),
'method' => 'textbox',
'size' => 3,
'max_length' => 3,
'default' => 20
),
'thold_alerting_header3' => array(
'friendly_name' => __('SNMP Notification Options', 'thold'),
'method' => 'spacer',
),
'thold_alert_snmp' => array(
'friendly_name' => __('SNMP Notifications', 'thold'),
'description' => __('Threshold status messages (informs/traps) will be sent to SNMP notification receivers. This includes Alerts, Warnings and Restoration traps per default. Note: This feature requires the Cacti SNMPAgent plugin.', 'thold'),
'method' => 'checkbox',
'default' => '0',
),
'thold_alert_snmp_warning' => array(
'friendly_name' => __('Disable Warning Notifications', 'thold'),
'description' => __('If this is checked, Threshold will not send a notification when a warning Threshold has been breached.', 'thold'),
'method' => 'checkbox'
),
'thold_alert_snmp_normal' => array(
'friendly_name' => __('Disable Restoration Notifications', 'thold'),
'description' => __('If this is checked, Threshold will not send a notification when the Threshold has returned to normal status.', 'thold'),
'method' => 'checkbox'
),
'thold_email_header' => array(
'friendly_name' => __('Emailing Options', 'thold'),
'method' => 'spacer',
),
'thold_email_prio' => array(
'friendly_name' => __('Send Emails with Urgent Priority', 'thold'),
'description' => __('Allows you to set Emails with urgent priority', 'thold'),
'method' => 'checkbox',
'default' => ''
),
'thold_send_text_only' => array(
'friendly_name' => __('Send Alerts as Text', 'thold'),
'description' => __('If checked, this will cause all Alerts to be sent as plain text Emails with no graph. The default is HTML Emails with the graph embedded in the Email.', 'thold'),
'method' => 'checkbox',
'default' => ''
),
'thold_send_email_separately' => array(
'friendly_name' => __('Send Email separately for each address', 'thold'),
'description' => __('If checked, this will cause all Emails to be sent separately for each address.', 'thold'),
'method' => 'checkbox',
'default' => ''
),
'thold_from_email' => array(
'friendly_name' => __('From Email Address', 'thold'),
'description' => __('This is the Email address that the Threshold will appear from.', 'thold'),
'method' => 'textbox',
'default' => read_config_option('settings_from_email'),
'max_length' => 255,
),
'thold_from_name' => array(
'friendly_name' => __('From Name', 'thold'),
'description' => __('This is the actual name that the Threshold will appear from.', 'thold'),
'method' => 'textbox',
'default' => read_config_option('settings_from_name'),
'max_length' => 255,
),
'thold_device_header' => array(
'friendly_name' => __('Device Notification Options', 'thold'),
'method' => 'spacer',
),
'alert_deadnotify' => array(
'friendly_name' => __('Enable Notifications', 'thold'),
'description' => __('Enable Dead/Recovering host notification', 'thold'),
'method' => 'checkbox',
'default' => 'on'
),
'alert_deadnotify_one_mail' => array(
'friendly_name' => __('Single Email Notification', 'thold'),
'description' => __('Supported for Notification Lists and the Notification Queue only. If there are Down Device Notifications in a single processing cycle. Send only one Email to Notification List repipients for all Devices.', 'thold'),
'method' => 'checkbox',
'default' => 'on'
),
'alert_deadnotify_subject' => array(
'friendly_name' => __('Single Email Notification Subject', 'thold'),
'description' => __('This is the Email Subject to be used for all Single Email Notification Emails for both Up and Down Devices.', 'thold'),
'method' => 'textbox',
'default' => 'Thold Device Notification: Up/Down Devices Found',
'size' => 80,
'max_length' => 255,
),
'thold_notification_delay' => array(
'friendly_name' => __('Device Notification Delay Options', 'thold'),
'description' => __('Device Notification Delay Options', 'thold'),
'method' => 'hidden',
//'method' => 'spacer',
),
'alert_notification_pause' => array(
'friendly_name' => __('Notification Delay', 'thold'),
'description' => __('If a large influx of Down Device Notifications come in, Cacti can pause sending out those Notifications for a certain period of time to see if the issue is transient before sending them out. Select the threshold Down Device Notifications before the Pause is Triggered.', 'thold'),
'array' => $notification_pause_values,
'method' => 'hidden',
//'method' => 'drop_multi',
'default' => '-1'
),
'alert_notification_delay' => array(
'friendly_name' => __('Notification Delay', 'thold'),
'description' => __('If you choose to delay Notifications for a large Down Devices Notification inrush, how long are you willing to wait before allowing the notifications to be processed?', 'thold'),
'array' => $notification_delay_values,
'method' => 'hidden',
//'method' => 'drop_array',
'default' => '-1'
),
'thold_device_email' => array(
'friendly_name' => __('Device Notification Email Options', 'thold'),
'method' => 'spacer',
),
'alert_email' => array(
'friendly_name' => __('Global Notification Email', 'thold'),
'description' => __('This is the Email Address that the Dead Device Notifications will be sent to if the Global Notification List is selected.', 'thold'),
'method' => 'textbox',
'size' => 80,
'max_length' => 255,
),
'thold_down_subject' => array(
'friendly_name' => __('Down Subject', 'thold'),
'description' => __('This is the Email subject that will be used for Down Device Messages. There are several common replacement tags that may be used in include:<br><HOSTNAME> <DESCRIPTION> <SITE> <LOCATION> <DOWN/UP> <DOWNTIME> (last state up duration in case down message) <NOTES>', 'thold'),
'method' => 'textbox',
'size' => 100,
'max_length' => 255,
'default' => __('Device Error: <DESCRIPTION> (<HOSTNAME>) is DOWN', 'thold'),
),
'thold_down_text' => array(
'friendly_name' => __('Down Message', 'thold'),
'description' => __('This is the message that will be displayed as the message body of all UP / Down Device Messages (1024 Char MAX). HTML is allowed, but will be removed for text only Emails. There are several common replacement tags that may be used in include:<br><HOSTNAME> <HOST_ID> <DESCRIPTION> <SITE> <LOCATION> <UPTIME> <UPTIMETEXT> <DOWNTIME> (last state up duration in case down message) <TIME> <DATE> <DATE_RFC822> <BREACHED_ITEMS> <MESSAGE> <SUBJECT> <DOWN/UP> <SNMP_HOSTNAME> <SNMP_LOCATION> <SNMP_CONTACT> <SNMP_SYSTEM> <LAST_FAIL> <AVAILABILITY> <TOT_POLL> <FAIL_POLL> <CUR_TIME> <AVG_TIME> <NOTES>', 'thold'),
'method' => 'textarea',
'class' => 'textAreaNotes',
'textarea_rows' => '7',
'textarea_cols' => '80',
'default' => __('System Error : <DESCRIPTION> (<HOSTNAME>) is <DOWN/UP><br><br>Site: <SITE><br>Location: <LOCATION><br>Reason: <MESSAGE><br>Average system response: <AVG_TIME> ms<br>System availability: <AVAILABILITY><br>Total Checks Since Clear: <TOT_POLL><br>Total Failed Checks: <FAIL_POLL><br>Last Date Checked DOWN : <LAST_FAIL><br>Device Previously UP for: <DOWNTIME><br>NOTES: <NOTES><br>Device NOTES: <DNOTES>', 'thold'),
),
'thold_up_subject' => array(
'friendly_name' => __('Recovering Subject', 'thold'),
'description' => __('This is the Email subject that will be used for Recovering Device Messages. There are several common replacement tags that may be used in include:<br><HOSTNAME> <DESCRIPTION> <SITE> <LOCATION> <DOWN/UP> <DOWNTIME> <NOTES>', 'thold'),
'method' => 'textbox',
'size' => 100,
'max_length' => 255,
'default' => __('Device Notice: <DESCRIPTION> (<HOSTNAME>) returned from DOWN state', 'thold'),
),
'thold_up_text' => array(
'friendly_name' => __('Recovering Message', 'thold'),
'description' => __('This is the message that will be displayed as the message body of all UP / Down Device Messages (1024 Char MAX). HTML is allowed, but will be removed for text only Emails. There are several common replacement tags that may be used in include:<br><HOSTNAME> <HOST_ID> <DESCRIPTION> <SITE> <LOCATION> <UPTIME> <UPTIMETEXT> <DOWNTIME> <TIME> <DATE> <DATE_RFC822> <BREACHED_ITEMS> <MESSAGE> <SUBJECT> <DOWN/UP> <SNMP_HOSTNAME> <SNMP_LOCATION> <SNMP_CONTACT> <SNMP_SYSTEM> <LAST_FAIL> <AVAILABILITY> <TOT_POLL> <FAIL_POLL> <CUR_TIME> <AVG_TIME> <NOTES>', 'thold'),
'method' => 'textarea',
'class' => 'textAreaNotes',
'textarea_rows' => '7',
'textarea_cols' => '80',
'default' => __('<br>System <DESCRIPTION> (<HOSTNAME>) status: <DOWN/UP><br><br>Site: <SITE><br>Location: <LOCATION><br>Current ping response: <CUR_TIME> ms<br>Average system response: <AVG_TIME> ms<br>System availability: <AVAILABILITY><br>Total Checks Since Clear: <TOT_POLL><br>Total Failed Checks: <FAIL_POLL><br>Last Date Checked UP: <LAST_FAIL><br>Device Previously DOWN for: <DOWNTIME><br><br>Snmp Info:<br>Name - <SNMP_HOSTNAME><br>Location - <SNMP_LOCATION><br>Uptime - <UPTIMETEXT> (<UPTIME> ms)<br>System - <SNMP_SYSTEM><br><br>NOTE: <NOTES><br>Device Notes: <DNOTES>', 'thold'),
),
'thold_device_command' => array(
'friendly_name' => __('Status Change Command', 'thold'),
'description' => __('When a Device changes state from a Cacti perspective (UP to DOWN or DOWN to RECOVERING/UP), run the following command. This command must NOT include command line arguments. However, the following variables can be pulled from the environment of the script:<br><THOLD_HOSTNAME> <THOLD_SITE> <THOLD_LOCATION> <THOLD_HOST_ID> <THOLD_DESCRIPTION> <THOLD_UPTIME> <THOLD_UPTIMETEXT> <THOLD_DOWNTIME> <THOLD_TIME> <THOLD_DATE> <THOLD_DATE_RFC822> <THOLD_BREACHED_ITEMS> <THOLD_MESSAGE> <THOLD_SUBJECT> <THOLD_DOWNUP> <THOLD_SNMP_HOSTNAME> <THOLD_SNMP_LOCATION> <THOLD_SNMP_CONTACT> <THOLD_SNMP_SYSTEM> <THOLD_LAST_FAIL> <THOLD_AVAILABILITY> <THOLD_TOT_POLL> <THOLD_FAIL_POLL> <THOLD_CUR_TIME> <THOLD_AVG_TIME> <THOLD_NOTES>', 'thold'),
'method' => 'filepath',
'file_type' => 'binary',
'size' => '100',
'max_length' => '100',
'default' => ''
),
'thold_notify_header' => array(
'friendly_name' => __('Alert/Warning Message Defaults', 'thold'),
'method' => 'spacer',
),
'thold_alert_text' => array(
'friendly_name' => __('Threshold Alert Message', 'thold'),
'description' => __('This is the message that will be displayed at the top of all Threshold Alerts (1024 Char MAX). HTML is allowed, but will be removed for text only Emails. There are several common replacement tags that may be used in include:<br><DESCRIPTION> <HOSTNAME> <HOST_ID> <SITE> <LOCATION> <TIME> <DATE> <DATE_RFC822> <BREACHED_ITEMS> <URL> <GRAPHID> <THOLD_ID> <CURRENTVALUE> <THRESHOLDNAME> <DSNAME> <SUBJECT> <GRAPH> <NOTES> <DNOTES>', 'thold'),
'method' => 'textarea',
'class' => 'textAreaNotes',
'textarea_rows' => '5',
'textarea_cols' => '80',
'default' => __('An Alert has been issued that requires your attention. <br><br><strong>Device</strong>: <DESCRIPTION> (<HOSTNAME>)<br><strong>URL</strong>: <URL><br><strong>Message</strong>: <SUBJECT><br><br><GRAPH>', 'thold'),
),
'thold_warning_text' => array(
'friendly_name' => __('Threshold Warning Message', 'thold'),
'description' => __('This is the message that will be displayed at the top of all Threshold warnings (1024 Char MAX). HTML is allowed, but will be removed for text only Emails. There are several common replacement tags that may be used in include:<br><DESCRIPTION> <HOSTNAME> <HOST_ID> <SITE> <LOCATION> <TIME> <DATE> <DATE_RFC822> <BREACHED_ITEMS> <URL> <GRAPHID> <THOLD_ID> <CURRENTVALUE> <THRESHOLDNAME> <DSNAME> <SUBJECT> <GRAPH> <NOTES> <DNOTES>', 'thold'),
'method' => 'textarea',
'class' => 'textAreaNotes',
'textarea_rows' => '5',
'textarea_cols' => '80',
'default' => __('A Warning has been issued that requires your attention. <br><br><strong>Device</strong>: <DESCRIPTION> (<HOSTNAME>)<br><strong>URL</strong>: <URL><br><strong>Message</strong>: <SUBJECT><br><br><GRAPH>', 'thold'),
),
'thold_restoral_text' => array(
'friendly_name' => __('Threshold Restoral Message', 'thold'),
'description' => __('This is the message that will be displayed at the top of all Threshold restoral notifications (1024 Chars MAX). HTML is allowed, but will be removed for text only Emails. There are several common replacement tags that may be used in include:<br><DESCRIPTION> <HOSTNAME> <HOST_ID> <SITE> <LOCATION> <TIME> <DATE> <DATE_RFC822> <BREACHED_ITEMS> <URL> <GRAPHID> <THOLD_ID> <CURRENTVALUE> <THRESHOLDNAME> <DSNAME> <SUBJECT> <GRAPH> <NOTES> <DNOTES>', 'thold'),
'method' => 'textarea',
'class' => 'textAreaNotes',
'textarea_rows' => '5',
'textarea_cols' => '80',
'default' => __('A Threshold has returned to normal status. <br><br><strong>Device</strong>: <DESCRIPTION> (<HOSTNAME>)<br><strong>URL</strong>: <URL><br><strong>Message</strong>: <SUBJECT><br><br><GRAPH>', 'thold'),
),
);
if (isset($temp)) {
$settings['alerts'] = array_merge($settings['alerts'], $temp);
}
}