@@ -423,6 +423,34 @@ process.stdin.on('end', () => {
423
423
return { ram, cpu, }
424
424
}
425
425
426
+ function getHostOS ( ) {
427
+ try {
428
+ const content = fs . readFileSync ( '/fylr/files/host-os-release' , 'utf8' ) ;
429
+ const lines = content . split ( '\n' ) ;
430
+ const osInfo = { } ;
431
+
432
+ lines . forEach ( line => {
433
+ if ( line . includes ( '=' ) ) {
434
+ let [ key , value ] = line . split ( '=' ) ;
435
+ // Remove any surrounding quotes
436
+ value = value . replace ( / ^ " ( .* ) " $ / , '$1' ) ;
437
+ osInfo [ key ] = value ;
438
+ }
439
+ } ) ;
440
+
441
+ return {
442
+ id : osInfo [ 'ID' ] ,
443
+ versionId : osInfo [ 'VERSION_ID' ] ,
444
+ prettyName : osInfo [ 'PRETTY_NAME' ] ,
445
+ codename : osInfo [ 'VERSION_CODENAME' ] ,
446
+ } ;
447
+
448
+ } catch ( error ) {
449
+ throwError ( "Fehler beim Auslesen des Host OS:" + error , '' ) ;
450
+ return null ;
451
+ }
452
+ }
453
+
426
454
function getPostgresVersion ( dsn ) {
427
455
return new Promise ( async ( resolve , reject ) => {
428
456
try {
@@ -474,6 +502,10 @@ process.stdin.on('end', () => {
474
502
// get ram, ram_quota, number of cpus, and cpu_quota
475
503
result . assigned_hardware = getHardwareStats ( ) ;
476
504
505
+ //////////////////////////////////////////////////////////////
506
+ // get ram, ram_quota, number of cpus, and cpu_quota
507
+ // result.host_data = getHostOS();
508
+
477
509
//////////////////////////////////////////////////////////////
478
510
// check mysql-backups, a successfull backup from yesterday is wanted
479
511
result . sqlbackups = infoData [ 11 ] ;
0 commit comments