Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@odain-cbd
Copy link
Contributor

@odain-cbd odain-cbd commented Oct 20, 2025

Goal

With this PR come 2 endpoints to deal with cron remotely and asynchronously. the idea is to execute cron.php with other PHP settings than iTop Webapp. And to avoid timeout issues for a script meant to last minutes...

  1. launch_cron_asynchronously

Parameters:

  • auth_user/ auth_pwd: credentials as usual
  • cron_log_file: cron output file. when not provided, default value is 'cron.log'
  • cron_cli_parameters: base64 encoded CLI parameters

curl -X POST -F 'version=1.3' -F "cron_cli_parameters=$CLIPARAM" "$ITOP_URL/webservices/launch_cron_asynchronously.php?version=-F 'auth_user=LOGIN' -F 'auth_pwd=PWD' {"message":"OK"}

  1. cron_status

Parameters:

  • auth_user/ auth_pwd: credentials as usual
  • cron_log_file: cron output file. when not provided, default value is 'cron.log'

curl -X POST -F 'version=1.3' -F "cron_cli_parameters=$CLIPARAM" "$ITOP_URL/webservices/cron_status.php?version=1.3&verbose=1" -F 'auth_user=LOGIN' -F 'auth_pwd=PWD' {"status":"stopped","message":"+---------------------------+---------+---------------------+---------------------+--------+-----------+\nExiting: 1760952914 (2025-10-20 11:35:14)"}

Warning:
It is not compatible with WINDOWS.

@odain-cbd odain-cbd self-assigned this Oct 20, 2025
@odain-cbd odain-cbd added the API label Oct 20, 2025
@CombodoApplicationsAccount CombodoApplicationsAccount added the internal Work made by Combodo label Oct 20, 2025
@odain-cbd odain-cbd closed this Oct 20, 2025
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this better be implemented as an option/argument on the current cron.php instead of yet another endpoint?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will take your point when team will discuss this enhancement

@odain-cbd odain-cbd reopened this Oct 21, 2025
@Hipska
Copy link
Contributor

Hipska commented Oct 21, 2025

And why do you always close/reopen PRs? πŸ˜›

@odain-cbd
Copy link
Contributor Author

And why do you always close/reopen PRs? πŸ˜›

50% obsessive compulsive disorder/ 50% superstition ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API internal Work made by Combodo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants