mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
Add InfrastructureAgent files to .gitignore and update daemon management logic in Index.ts
This commit is contained in:
parent
f8eaeb52a1
commit
2e7ea183e6
7
.gitignore
vendored
7
.gitignore
vendored
@ -102,4 +102,9 @@ Examples/otel-dotnet/obj/*
|
||||
|
||||
InfrastructureAgent/sea-prep.blob
|
||||
InfrastructureAgent/InfrastructureAgent
|
||||
InfrastructureAgent/build/*
|
||||
InfrastructureAgent/build/*
|
||||
|
||||
|
||||
InfrastructureAgent/err.log
|
||||
InfrastructureAgent/out.log
|
||||
InfrastructureAgent/daemon.pid
|
@ -52,8 +52,8 @@ const returnValue:
|
||||
demandOption: false,
|
||||
});
|
||||
},
|
||||
async (y: any) => {
|
||||
const argv: ArgumentType = y.argv as ArgumentType;
|
||||
async (y: yargs.ArgumentsCamelCase) => {
|
||||
const argv: ArgumentType = y as ArgumentType;
|
||||
|
||||
// add secrt key and oneuptime url
|
||||
|
||||
@ -146,6 +146,15 @@ const returnValue:
|
||||
'Show status of daemon',
|
||||
() => {},
|
||||
() => {
|
||||
// check if daemon.pid file exists
|
||||
|
||||
const doesFileExist: boolean = fs.existsSync('./daemon.pid');
|
||||
|
||||
if (!doesFileExist) {
|
||||
Logger.info('OneUptime Infrastructure Agent is not running');
|
||||
return;
|
||||
}
|
||||
|
||||
const pid: string | number = fs
|
||||
.readFileSync('./daemon.pid', 'utf-8')
|
||||
.trim();
|
||||
|
@ -75,7 +75,7 @@ export default class MonitorInfrastructure {
|
||||
};
|
||||
|
||||
Logger.info('Server Monitor Response');
|
||||
Logger.info(JSON.stringify(serverMonitorResponse));
|
||||
Logger.info(JSON.stringify(serverMonitorResponse, null, 2));
|
||||
|
||||
// now we send this data back to server.
|
||||
|
||||
|
@ -22,6 +22,18 @@ Once its up and running you should see the metrics on the OneUptime Dashboard.
|
||||
oneuptime-infrastructure-agent stop
|
||||
```
|
||||
|
||||
## Check the status of the agent
|
||||
|
||||
```
|
||||
oneuptime-infrastructure-agent status
|
||||
```
|
||||
|
||||
## Logs
|
||||
|
||||
```
|
||||
oneuptime-infrastructure-agent logs
|
||||
```
|
||||
|
||||
## Uninstalling the agent
|
||||
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user