You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add remote linux server to your server stats. This is meant for servers that do not run PHP, e.g. database or cache servers. Servers that run PHP should install their own instance of Laravel Pulse instead.
4
+
5
+
## Installation
6
+
7
+
Install the package using Composer:
8
+
9
+
```shell
10
+
composer require wrklst/pulse-remote-server
11
+
```
12
+
13
+
## Register the recorder
14
+
15
+
In your `pulse.php` configuration file, register the RemoteServerRecorder with the desired settings:
Requires SSH key authentication in place for authentication to remote server.
4
+
Remote Server is assumed to be running Ubuntu Linux.
5
+
This is usefull to record server performance for database/cache/queue etc only servers, that do not have pulse installed, which would also require nginx and php etc.
6
+
Instead the performance measurement is taken from the app server via ssh remote commands.
7
+
*/
8
+
9
+
namespaceWrkLst\Pulse\RemoteServer\Recorders;
10
+
11
+
useIlluminate\Config\Repository;
12
+
useIlluminate\Support\Str;
13
+
useLaravel\Pulse\Events\SharedBeat;
14
+
useLaravel\Pulse\Pulse;
15
+
useRuntimeException;
16
+
17
+
/**
18
+
* @internal
19
+
*/
20
+
class RemoteServers
21
+
{
22
+
/**
23
+
* The events to listen for.
24
+
*
25
+
* @var class-string
26
+
*/
27
+
publicstring$listen = SharedBeat::class;
28
+
29
+
/**
30
+
* Create a new recorder instance.
31
+
*/
32
+
publicfunction__construct(
33
+
protectedPulse$pulse,
34
+
protectedRepository$config
35
+
) {
36
+
//
37
+
}
38
+
39
+
/**
40
+
* Record the system stats.
41
+
*/
42
+
publicfunctionrecord(SharedBeat$event): void
43
+
{
44
+
// run every 30 seconds, comapared to than every 15 seconds (what is the default for the Pulse Servers recorder)
45
+
// this is to reduce the amount of ssh commands (4 per run)
0 commit comments