forked from Cacti/plugin_mactrack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCactiCheatSheet.md
More file actions
124 lines (73 loc) · 3.1 KB
/
Copy pathCactiCheatSheet.md
File metadata and controls
124 lines (73 loc) · 3.1 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
# Cacti documentation
[TOC]
## Changes made in Mactrack plugin
### Fixing bug: mac addresses were not visible under MAC Addresses tab
https://github.com/Cacti/plugin_mactrack/commit/cc681b143cfdd43ec79a800009699308d5832407
The bug occurred when using Juniper EX2200 Switches.
```php
$Xvlanid = substr($num, 0, strpos($num, '.'));
```
was changed to
```php
$Xvlanid = substr($num, strpos($num, '.')+1, strpos($num, '.',1)-1);
```
and
```php
$ifIndex = @$port_results[$mac_result];
```
was changed to
```php
$ifIndex = @$port_results[".".strval($mac_result)];
```
in the `lib\mactrack_juniper.php` file.
An extra dot was added to the keys of the port dictionary when it was made from the OID.
### More bug fixing with Juniper switches
https://github.com/Cacti/plugin_mactrack/commit/f2deee43c1229e5bd3110e19e685153b57bfc76c
Changes are available on the link above.
#### Fixing bug: The MAC addresses had 7 groups instead of 6. They were too long.
Basically the start position of the substring was wrong.
#### Fixing Juniper trunk port counter
When using Juniper switches the trunk counter was not implemented.
```php
/* get VLAN Trunk status */
$vlan_trunkstatus = xform_standard_indexed_data('.1.3.6.1.4.1.2636.3.40.1.5.1.7.1.5', $device);
foreach ($vlan_trunkstatus as $vts) {
if ($vts == 2) {
$device['ports_trunk']++;
}
}
```
was added to the code.
#### Fixing: port names issue
Changed Juniper port names, port numbers and port descriptions according to Cisco's equivalent of the same fields in the DB.
Port number became Interface name (e.g. ge-0/0/0.0).
Port name became Interface description.
Port description was added to $ifInterfaces.
Tested with EX-2200 switches.
#### Interface description are now visible under the interfaces tab and port_name cannot be null.
https://github.com/Cacti/plugin_mactrack/commit/bc5ba709134006488a80b4cf3beae782fd9fbd84
### Juniper port ignore
https://github.com/Cacti/plugin_mactrack/commits/develop (it was not accepted by the official Cacti repository when the documentation was made.)
Port ignore option was not implemented for Juniper switches.
## Mactrack cheat sheet
### mactrack scanner
Main debugging tool:
-d stands for debug mode.
-id=deviceid selects the device on which the scan will run
The result of the scan will be saved to the **mac_track_temp_ports** table in mysql. It won't be merged into the **mac_track_ports** table which is used by Cacti to build the view macs webpage.
```bash
php mactrack_scanner.php -d -id=10
```
### mactrack poller
It runs the SNMP poller on all devices
```bash
php poller_mactrack.php -d -f
```
-d stands for debug mode
-f means force (~ run now, don't wait for the next scheduled scan.)
### Terminated mactrack process
If the poller or the scanner was terminated you should clear the **mac_track_processes** table by hand.
### Clear mac addresses
To clear the mac addresses from Cacti you should **TRUNCATE** the **mac_track_ports** table.
### Duplicate device bug
When editing a device from Cacti you should check **mac_track_devices** table. Sometimes it makes a duplicate entry. Simply delete the old one.