OCSInventory-Docker-Image icon indicating copy to clipboard operation
OCSInventory-Docker-Image copied to clipboard

software inventory empty in 2.9 image

Open babaymaster opened this issue 4 years ago • 1 comments

Hi.

By default software inventory is empty. For solve this issue need add crontab in image and add task. For example : Dockerfile

RUN yum ${YUM_FLAGS} install wget
curl
*crontabs * yum-utils
tar \

add line in Dockerfile

COPY ocs-inventory-cron /etc/cron.d/ocs-inventory-cron RUN chmod 0644 /etc/cron.d/ocs-inventory-cron RUN crontab /etc/cron.d/ocs-inventory-cron RUN touch /var/log/cron.log CMD cron && tail -f /var/log/cron.log

file ocs-inventory-cron 0 23 * * * cd /usr/share/ocsinventory-reports/ocsreports/crontab && php73 cron_all_software.php

babaymaster avatar Oct 19 '21 03:10 babaymaster

@babaymaster thanks for reporting.

@gillesdubois I reproduced this issue and I'm working in a solution.

wiltonsr avatar Nov 05 '21 12:11 wiltonsr

Any update on this issue? I'm running ocsinventory/ocsinventory-docker-image:2.10 image, and cron support completely missing from image, and also OCSReports cron files also not running on a schedule. "All Software" list always empty...

gallogabor avatar Dec 06 '22 20:12 gallogabor

I closed the PR because the base image is no longer based on centos.

As a workaround, you could configure a crontab directly in your server that runs docker and execute:

0 0 * * * root docker exec <your_container_name> bash -c 'cd /usr/share/ocsinventory-reports/ocsreports/crontab && php cron_all_software.php'

wiltonsr avatar Dec 06 '22 20:12 wiltonsr

@wiltonsr Thank you for your quick help! I implement this, I didn't think outside of the container until now... :-)

gallogabor avatar Dec 06 '22 21:12 gallogabor

Hi,

We'll implement a note in the wiki in order to implement crontab for the docker instance :)

Regards, Gilles.

gillesdubois avatar Dec 07 '22 10:12 gillesdubois