Once you have met the qualifications to add a monitor (by subscribing or joining a team with an active subscription), you will see a button
at the top of the screen titled "Add New CRON Monitor." Activating this button will take you to an interface to create a CRON job monitor.
In this screen, you will be asked to specify certain details about the job that is being monitored and the monitor itself. The "Workspace" you choose for the monitor could be "Personal"
if your subscription allows it, or any teams that qualify for new CRON monitors based upon their subscriptions. You may choose to track when the job ends as well, which will allow you to
receive a notification when the job runs for longer than expected.
Once you have saved the details of your monitor, you will be provided with API endpoints that you will place into your CRON job script. The "Start" URL should be pinged by your script
on the very first line of code for the CRON job letting Argus know execution has begun. The "End" URL (if applicable) should be pinged on the final line of code, letting Argus know execution
has completed. Finally, at any point in your script where you wish to log error behavior, use the "Error" endpoint to pass error messages to be logged by Argus.
In the upper right corner of the Monitor screen, you may select which events you would like Argus to log for this monitor (all events are logged by default). And at the bottom
of the screen, you may specify which types of activity should trigger a notification to you.
The 'Start' API endpoint is your endpoint to let the Argus system know the cron job has started. It's a simple GET endpoint. You can notify it by simply sending a curl request such as
curl https://argus.to/your_unique/endpoint_url/done
at the start of your cron job or before it like curl https://argus.to/your_unique/endpoint_url/done && /run/scheduled/cron/job
If you are on the Laravel framework, all you need to do is at the `thenPing` directive to your scheduler.
$schedule->command('emails:send') ->daily() ->thenPing('https://argus.to/your_unique/endpoint_url/done');
The Start endpoint is the only required endpoint you need to hit.
The 'End' API endpoint is your endpoint to let the Argus system know the cron job has finished. It's a simple GET endpoint. You can notify it by simply sending a curl request such as curl https://argus.to/your_unique/endpoint_url/done at the end of your cron job.
If you are on the Laravel framework, all you need to do is at the thenPingOnSuccess directive to your scheduler.
$schedule->command('emails:send') ->daily() ->pingOnSuccess('https://argus.to/your_unique/endpoint_url/done');
The 'Error' API endpoint is your endpoint to let the Argus system know the cron job has thrown an error. It can be a simple GET endpoint if you just want to log that an error occurred. You can notify it by simply sending a curl request such as curl https://argus.to/your_unique/endpoint_url/error when you capture the error.
If you are on the Laravel framework, all you need to do is at the `pingOnFailure` directive to your scheduler.
$schedule->command('emails:send')
->daily()
->pingOnFailure('https://argus.to/your_unique/endpoint_url/error');
If you wish to pass a JSON message with your error, you can also make a POST request to the same endpoint with your message. An example of that might be something like
curl -d '{"status":"error", "message":"add your error message here"}' -H "Content-Type: application/json" -X POST https://argus.to/your_unique/endpoint_url/error
Testing your monitors is very easy. Simply copy the "Start" endpoint URL and paste it into the URL bar of a browser. You will see the message "OK," and
Argus is now tracking that job to see when it will end or receive error notifications. If you have the monitor configured to track the end of the job, you may wait past the time
period you specified to receive a notification that the job did not end during the expected time period. Likewise, you may paste the "End" url into the browser to tell Argus the job has
completed execution.
If you wish to test error logging, copy the "Error" endpoint and paste it into your computer's terminal application. Change the "message" portion of the JSON element to test
the error message you wish to log.
API calls will be listed in your CRON monitors after you create them. There will be separate calls for the start of the job, the end of the job
(if you choose to track that), and any errors that occur during the execution of the job.
The "Start" URL should be pinged by your script on the very first line of code for the CRON job letting Argus know execution has begun. The "End" URL (if applicable) should
be pinged on the final line of code, letting Argus know execution has completed. Finally, at any point in your script where you wish to log error behavior, use the "Error"
endpoint to pass error messages to be logged by Argus.
Any service or function that can reach out to an external HTML endpoint can be utilized. For example, nearly all languages have a cURL funtion. GuzzleHTTP is also a popular
choice for PHP-based systems. Any service that can perform GET and POST requests to external URLs can be used.
Yes, API tokens are assigned upon account creation but can be changed at any time. The token will be included in the API endpoint URLs of your
CRON job monitors, so if you do change your token, be sure to update the URLs in every place you are making API calls in your CRON job scripts.
To change your API token, go to the main application menu and choose "Settings." At the bottom of the page, you will see an option to reset your API token. Choose this option
and then confirm. Your new API token will be displayed, and if you go to your CRON job monitors, you will see that all URLs now contain a reference to this new token.
Yes, a monitor may be deacitivated, which will prevent it from running and sending out notifications. To deactivate a CRON job monitor, go to
the Cronjobs screen (by selecting "Cronjobs" in the side menu. Choose the monitor you wish to deactivate, then select the "Edit Monitor" button. One of the options here is titled
"This Monitor is Active." Toggle that option to the off position and then save. You will see the word "Deactivated" is now present in your monitor's title.
To reactivate the monitor later, follow the same steps but instead toggle the "This Monitor is Active" option to the on position.
All Argus APIs currently return "OK" on a successful call. This can be tested by simply entering the "start" or "end" API URLs into a browser.