Commit Graph

298 Commits (88297c60c32f662373d6eda140b2d5dd4c8d00df)

Author SHA1 Message Date
Juan Manuel Bardallo 88297c60c3 Fix(ogagent): prevent duplicate trace creation by removing START_SCRIPT webhook for synchronous execution paths
ogagent/pipeline/head This commit looks good Details
2026-07-27 18:52:00 +02:00
Juan Manuel Bardallo 5b286e005c Fix(ogagent): preserve PowerShell exit code when redirecting output
ogagent/pipeline/head This commit looks good Details
2026-07-27 18:35:50 +02:00
Juan Manuel Bardallo 43c57ea320 Fix(jobmgr): send START_SCRIPT webhook when script is run under user session (client=true)
ogagent/pipeline/head This commit looks good Details
2026-07-22 14:37:17 +02:00
Juan Manuel Bardallo 70f85b1fc7 Feat(jobmgr): send START_SCRIPT webhook to mark trace as in_progress ; Fix(windows): prevent CLIXML output on errors by piping to Out-String
ogagent/pipeline/head This commit looks good Details
2026-07-22 14:19:52 +02:00
Juan Manuel Bardallo d0bde04e92 chore: bump version to 8.5.6 for webhook feature 2026-07-21 12:27:56 +02:00
Juan Manuel Bardallo d2ff2d1b35 feat: notify ogcore when script execution finishes natively 2026-07-21 12:20:17 +02:00
Juan Manuel Bardallo 0db7dbce9f refactor(deps): remove obsolete dependencies and support modern Ubuntu
ogagent/pipeline/head There was a failure building this commit Details
2026-07-09 11:56:53 +02:00
Nicolas Arenas 25fc2cf5f8 feat(ogagent): select network interface by routing table instead of first found
ogagent/pipeline/head This commit looks good Details
On machines with multiple NICs, the agent was always registering with
ogcore using the first interface returned by the OS, which could be the
wrong one if it wasn't the interface with a route to ogcore.

_best_interface() opens a no-op UDP socket toward the ogcore host and
reads the local IP assigned by the kernel routing table, then matches it
against the available interfaces. If the routing query fails (network not
ready yet) it returns None so the detection loop keeps retrying rather
than accepting a wrong interface. Falls back to nets[0] only when the
query succeeds but no interface matches (NAT/VPN scenario).
2026-05-20 14:19:08 +02:00
Nicolas Arenas 7728831983 Update oglog levels for oglive
ogagent/pipeline/head This commit looks good Details
2026-05-13 10:04:21 +02:00
Nicolas Arenas 0bfd129c9e Call CoInitializer in windows at staturup thread 2026-05-11 17:34:16 +02:00
Nicolas Arenas c3051a75b9 Creates background thread to fix network detectino problem
ogagent/pipeline/head This commit looks good Details
2026-05-11 16:06:27 +02:00
Nicolas Arenas da50ab5e7f feat(ogagent): report busy state and os type in heartbeat ping
Add 'busy' and 'st' fields to the periodic webhook ping so ogCore can
track whether a client is executing a job without waiting for a command
response.

- oglive_worker: busy derived from thread_list running state, st='OGL'
- OpenGnSys module: busy derived from jobmgr active processes, st mapped
  from operations.os_type (LNX/WIN/OSX)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 20:36:45 +02:00
Nicolas Arenas fbcbbb6397 Fix do_POST sending 500 before handler runs on empty body
POST requests without a body (e.g. Reiniciar, Apagar) caused
json.loads("") to raise JSONDecodeError, which sent a 500 response
but continued executing the handler, resulting in a double response.
The client received 500 while the handler actually succeeded.

- Handle missing or zero Content-Length without attempting JSON parse
- Add return after sendJsonError to prevent calling notifyMessage after
  an error response has already been sent
2026-04-28 23:23:00 +02:00
Nicolas Arenas d585387f52 Reconnect to ogcore after connection loss
- Track registration state with _registered flag; monitoring thread
  re-sends ogagent/started when contact with ogcore is restored
- Fix AttributeError in REST client when a network-level error
  (timeout, connection refused) occurred: e.response is None for
  non-HTTP failures, so guard before accessing .status_code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 21:06:40 +02:00
Nicolas Arenas 7086cf1467 Change http server order start 2026-04-28 17:57:41 +02:00
Nicolas Arenas ee5710fffc Add ogagent.token file in oglive mode only (#70)
ogagent/pipeline/head This commit looks good Details
## Summary

- Write the authentication token to `/tmp/ogagent.token` on oglive startup so local scripts can authenticate against the agent without needing to know the token in advance.
- Remove token file writing from OS/Windows mode (`OpenGnSys` module), where it was being written to `/opt/opengnsys/etc/ogagent.token`. The token file is now exclusive to oglive mode.

## Test plan

- [ ] Boot a machine into oglive and verify `/tmp/ogagent.token` is created with a 32-character alphanumeric token
- [ ] Verify a local script can read the token and use it to authenticate against the agent REST API
- [ ] Boot a machine into a normal OS (Windows/Linux) and verify `/opt/opengnsys/etc/ogagent.token` is **not** created
- [ ] Verify normal agent operation is not affected in OS mode (connection to ogcore, script execution, etc.)

Co-authored-by: Nicolas Arenas <nicolas.arenas@qindel.com>
Reviewed-on: #70
2026-03-23 17:38:50 +01:00
Nicolas Arenas c776f9c2ee Fix Redmine 2879 (#69)
ogagent/pipeline/head This commit looks good Details
Co-authored-by: Nicolas Arenas <nicolas.arenas@qindel.com>
Reviewed-on: #69
2026-03-18 17:35:34 +01:00
Natalia Serrano b922c4270c refs #2862 parches ugr 2025-10-16 14:52:04 +02:00
Natalia Serrano 9e750cef68 refs #2862 parches ugr 2025-10-16 14:49:50 +02:00
Natalia Serrano 150ea63764 refs #2862 parches ugr 2025-10-15 10:42:09 +02:00
Natalia Serrano cd16f873d5 refs #2850 show a user-friendly error if the agent fails to start 2025-09-29 15:42:03 +02:00
Natalia Serrano 99d9eba0c3 refs #2850 show a user-friendly error if the agent fails to start 2025-09-29 15:40:34 +02:00
Natalia Serrano f02198405e refs #2840 exit from the infinite loop 2025-09-23 13:46:22 +02:00
Natalia Serrano bbd03af7ad refs #2822 wait() in a loop 2025-09-18 11:29:29 +02:00
Natalia Serrano cd62b779a1 refs #2776 Fix EOF bug in interfaceAdm() 2025-09-11 16:33:21 +02:00
Natalia Serrano 07740884cb refs #2691 put InventarioHardware to work 2025-08-29 10:32:06 +02:00
Vadim vtroshchinskiy 8ba4240fee refs #2506 argument fixes 2025-08-28 15:20:27 +02:00
Vadim vtroshchinskiy 163c6fb4fe refs #2506 -- Make some parameters optional 2025-08-28 15:20:27 +02:00
Vadim Trochinsky 2a2fc3b0b2 refs #2506 -- More parameter rearranging 2025-08-28 15:20:27 +02:00
Vadim Trochinsky 0bf4b53ef8 refs #2506 -- Rearrange parameters, add ability to pass branch to oggit 2025-08-28 15:20:27 +02:00
Vadim Trochinsky 6ecf399ffe refs #2506 modificarimagen con branch y parametros 2025-08-28 15:20:27 +02:00
Natalia Serrano c60931ed9a refs #2688 make Configurar with gen-script=true both synchronous and faster 2025-08-28 12:48:45 +02:00
Natalia Serrano ac24d63b70 refs #2688 pass a new parameter "gen-script" to Configurar 2025-08-28 11:35:21 +02:00
Vadim vtroshchinskiy daff276aa0 refs #2621: Redo interfaceAdmin to avoid truncating output 2025-08-14 10:03:35 +02:00
Natalia Serrano abc2de9f70 refs #2615 update changelogs 2025-08-08 13:14:05 +02:00
Natalia Serrano e8e858d4ce refs #2615 return 409 on >1 background jobs 2025-08-08 13:12:21 +02:00
Natalia Serrano 40064be81d refs #2616 handle nested exceptions 2025-08-08 13:11:41 +02:00
Natalia Serrano b17d25083b refs #2600 wait() for the browser 2025-08-07 12:10:00 +02:00
Natalia Serrano 83a25947bd refs #2592 fix syntax 2025-08-04 14:37:56 +02:00
Natalia Serrano 8b8204d10f refs #2558 #2559 #2562 #2563 add versioning stuff 2025-08-04 14:24:22 +02:00
Natalia Serrano 25b2cb6cd8 refs #2558 #2559 return job_id to ogcore 2025-08-04 14:21:04 +02:00
Natalia Serrano fc8b072860 refs #2563 log the logging-out user 2025-08-04 12:26:19 +02:00
Natalia Serrano 860fb61677 refs #2562 keep track of the logging-out user 2025-08-04 12:25:56 +02:00
Natalia Serrano 75d222c425 refs #2554 wait for zombies 2025-07-31 10:36:00 +02:00
Natalia Serrano e783d7c1fa refs #2554 wait for zombies 2025-07-31 10:34:01 +02:00
Natalia Serrano ee183f6ad3 refs #2556 change "jobid" for "job_id" 2025-07-31 10:18:19 +02:00
Natalia Serrano 95360a244e refs #2547 add missing file stop-agent.ps1 2025-07-30 10:21:02 +02:00
Natalia Serrano 9fe1b5d1d5 refs #2509 use setsid, send signals to the pgrp 2025-07-29 14:12:56 +02:00
Natalia Serrano c53be3f3ec refs #2537 log whether we are in ogLive or not 2025-07-28 15:17:40 +02:00
Natalia Serrano 198353b214 refs #2537 log whether we are in ogLive or not 2025-07-28 13:56:56 +02:00