You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2017-06-10 00:22:31

crypto_root
Member
From: Costa Rica
Registered: 2016-05-02
Posts: 7
Website

Using CLI for specific notifications or alarms

Hi.
I have configured my notifications by CLI each 2 minutes (*/2 * * * * apache /usr/bin/php /var/www/html/glpi/front/cron.php). The problem I have is that I want to trigger alarms at different time. For example, I need to send alarm on Event Consumable Alarm when Threshold is reached or in the last case each week, not at the same time within the rest included in cron.php

Some help or clue is welcome.

Offline

#2 2017-06-10 07:14:37

remi
GLPI-DEV
From: Champagne
Registered: 2007-04-28
Posts: 7,127
Website

Re: Using CLI for specific notifications or alarms

cron.php accepts additional arguments for tasks to run
So Using "consumable" should do  the trick.


Dév. Fedora 29 - PHP 5.6/7.0/7.1/7.2/7.3/7.4 - MariaDB 10.3 - GLPI master
Certifié ITILv3 - RPM pour Fedora, RHEL et CentOS sur https://blog.remirepo.net/

Offline

#3 2017-06-10 17:07:16

crypto_root
Member
From: Costa Rica
Registered: 2016-05-02
Posts: 7
Website

Re: Using CLI for specific notifications or alarms

Oh great tip ! And do you know where I can find the argument list?. For the moment I'll try with that argument, thank you very much

Last edited by crypto_root (2017-06-10 17:07:55)

Offline

#4 2017-06-12 15:57:53

TheLastSuperSaiyan
Member
Registered: 2017-05-30
Posts: 4

Re: Using CLI for specific notifications or alarms

Hi,

I may be wrong but I suspect that the arguments could be the tasks created in Setup->Automatic actions???

Offline

#5 2017-06-12 16:13:24

crypto_root
Member
From: Costa Rica
Registered: 2016-05-02
Posts: 7
Website

Re: Using CLI for specific notifications or alarms

As far as I know in Automatic actions you only defined the execution using GLPI (in my understand trigger actions when users are active in the website) or CLI defined in the crontab of the Linux OS, in my case I edited /etc/crontab and schedule the cron.php each 2 minutes, w/o arguments, thing what will be worth, to execute just specific actions.

Offline

#6 2017-06-12 16:39:50

TheLastSuperSaiyan
Member
Registered: 2017-05-30
Posts: 4

Re: Using CLI for specific notifications or alarms

crypto_root, I did a similar cron setup for the mail receiver and mail queue of the helpdesk. I think I'll try out my theory tomorrow. Disable an automatic task and run it using cron.php passing the task name as a parameter.

Quick update.
consumable I disabled long time ago in my setup and I just ran cron directly from the commandline. I used '/usr/bin/php cron.php --force consumable' and output in cron.log is,
2017-06-12 14:48:50 [@glpi]
External #1: Launch consumable

Perhaps an indication it did actually run??? Still not sure.

Last edited by TheLastSuperSaiyan (2017-06-12 16:53:34)

Offline

Board footer

Powered by FluxBB