Skip to content

Commit 3d5824b

Browse files
authored
🔀 Merge pull request #1830 from conlan0/master
Change: Tactical RMM Now Uses Monitoring V2
2 parents 92e560c + 8e4153d commit 3d5824b

2 files changed

Lines changed: 28 additions & 38 deletions

File tree

docs/widgets.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2784,14 +2784,15 @@ Linkding is a self-hosted bookmarking service, which has a clean interface and i
27842784

27852785
[Tactical RMM](https://github.com/amidaware/tacticalrmm) is a self-hosted remote monitoring & management tool.
27862786

2787-
<p align="center"><a href="https://ibb.co/NVHWpD1"><img src="https://pixelflare.cc/alicia/dashy/tactical-rmm" alt="Capture" border="0"></a></p>
2787+
<p align="center"><a href="https://github.com/user-attachments/assets/152a7205-e5de-401f-bad8-19063ddfaf3c">
2788+
<img src="https://github.com/user-attachments/assets/5921d46f-d84c-494d-8aaf-6b20cc592640" alt="Capture" border="0"></a></p>
27882789

27892790

27902791
#### Options
27912792

27922793
| **Field** | **Type** | **Required** | **Description** |
27932794
| ------------ | -------- | ------------ | ------------------------------------------------------------------------ |
2794-
| **`url`** | `string` | Required | The status endpoint URL (https://api.example.com/core/status/) |
2795+
| **`url`** | `string` | Required | The status endpoint URL (https://api.example.com/core/v2/status/) |
27952796
| **`token`** | `string` | Required | The MON_TOKEN (see https://docs.tacticalrmm.com/tipsntricks/#monitor-your-trmm-instance-via-the-built-in-monitoring-endpoint). |
27962797

27972798
#### Example
@@ -2801,7 +2802,7 @@ Linkding is a self-hosted bookmarking service, which has a clean interface and i
28012802
useProxy: true
28022803
options:
28032804
token: PkPVKMzbmXgeQDlJWb0WXYvsIk3JvZyadURud2cSTdMia6hUbQ
2804-
url: https://api.example.com/core/status/
2805+
url: https://api.example.com/core/v2/status/
28052806
```
28062807

28072808
#### Info

src/components/Widgets/TacticalRMM.vue

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,26 @@
3434
<div class="title">Cert Expired</div>
3535
<div class="value">{{ statusData.cert_expired ? 'Yes' : 'No' }}</div>
3636
</div>
37+
<div class="status-item">
38+
<div class="title">Celery Queue Length</div>
39+
<div class="value">{{ statusData.celery_queue_len }}</div>
40+
</div>
41+
<div class="status-item">
42+
<div class="title">Celery Queue Health</div>
43+
<div class="value">{{ statusData.celery_queue_health }}</div>
44+
</div>
45+
<div class="status-item">
46+
<div class="title">NATS STD Ping</div>
47+
<div class="value">{{ statusData.nats_std_ping ? 'Healthy' : 'Unhealthy' }}</div>
48+
</div>
49+
<div class="status-item">
50+
<div class="title">NATS WS Ping</div>
51+
<div class="value">{{ statusData.nats_ws_ping ? 'Healthy' : 'Unhealthy' }}</div>
52+
</div>
53+
<div class="status-item">
54+
<div class="title">Mesh Ping</div>
55+
<div class="value">{{ statusData.mesh_ping ? 'Healthy' : 'Unhealthy' }}</div>
56+
</div>
3757
<div class="status-item services">
3858
<div class="title">Services Running</div>
3959
<div class="services-list">
@@ -61,18 +81,10 @@
6181
</template>
6282

6383
<script>
64-
import request from '@/utils/request';
6584
import WidgetMixin from '@/mixins/WidgetMixin';
66-
import { serviceEndpoints } from '@/utils/defaults';
6785
6886
export default {
6987
mixins: [WidgetMixin],
70-
props: {
71-
options: {
72-
type: Object,
73-
default: () => ({}),
74-
},
75-
},
7688
data() {
7789
return {
7890
statusData: null,
@@ -95,50 +107,27 @@ export default {
95107
},
96108
authHeaders() {
97109
return {
110+
'X-MON-TOKEN': this.token,
98111
'Content-Type': 'application/json',
99112
};
100113
},
101-
proxyReqEndpoint() {
102-
const baseUrl = process.env.VUE_APP_DOMAIN || window.location.origin;
103-
return `${baseUrl}${serviceEndpoints.corsProxy}`;
104-
},
105114
},
106115
methods: {
107116
update() {
108117
this.startLoading();
109118
this.fetchData();
110119
},
111120
fetchData() {
112-
const {
113-
authHeaders, url, token, proxyReqEndpoint,
114-
} = this;
115-
121+
const { authHeaders, url, token } = this;
116122
if (!this.optionsValid({ url, token })) {
117123
return;
118124
}
119-
120-
const targetURL = url;
121-
const customHeaders = JSON.stringify(authHeaders);
122-
123-
request.post(
124-
proxyReqEndpoint,
125-
{ auth: token },
126-
{
127-
headers: {
128-
'Target-URL': targetURL,
129-
CustomHeaders: customHeaders,
130-
'Content-Type': 'application/json',
131-
},
132-
},
133-
)
125+
this.makeRequest(url, authHeaders)
134126
.then((response) => {
135-
this.processData(response.data);
127+
this.processData(response);
136128
})
137129
.catch(() => {
138130
this.errorMessage = 'Failed to fetch data';
139-
})
140-
.finally(() => {
141-
this.finishLoading();
142131
});
143132
},
144133
processData(response) {

0 commit comments

Comments
 (0)