-
Notifications
You must be signed in to change notification settings - Fork 2
/
Item.cs
67 lines (57 loc) · 1.73 KB
/
Item.cs
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
namespace ZabbixTemplates
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
public class Item
{
public Item()
{
Applications = new ApplicationSet();
}
public Item (PerformanceCounter pdhCounter, String instanceName = "") : this() {
Name = pdhCounter.CounterName;
Description = pdhCounter.CounterHelp;
Key = String.IsNullOrEmpty(instanceName) ?
String.Format(@"perf_counter[""\{0}\{1}""]", pdhCounter.CategoryName, pdhCounter.CounterName) :
String.Format(@"perf_counter[""\{0} ({1})\{2}""]", pdhCounter.CategoryName, instanceName, pdhCounter.CounterName);
}
private int _delay = 60;
private int _history = 7;
private int _trends = 365;
public string Name { get; set; }
public string Description { get; set; }
public ItemType ItemType { get; set; }
public string Key { get; set; }
public ItemStatus Status { get; set; }
public ApplicationSet Applications { get; protected set; }
public int Delay
{
get { return _delay; }
set { _delay = value; }
}
public int History
{
get { return _history; }
set { _history = value; }
}
public int Trends
{
get { return _trends; }
set { _trends = value; }
}
}
public class ItemCollection : List<Item>
{
public ItemCollection() : base() { }
}
public enum ItemType {
ZabbixAgent = 0,
ZabbixAgentActive = 7
}
public enum ItemStatus
{
Enabled = 0,
Disabled = 1,
}
}