Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.8 available

The official documentation can be found on http://wiki.ocsinventory-ng.org. Read it before asking your question.

Cron of rpm ocsinventory-agent-core

Hello,

We deployed ocs agent on RHEL using rpm found on official repository (https://rpm.ocsinventory-ng.org/enterprise).

The rpm ocsinventory-agent has the ocsinventory-agent-core dependency. No worry about that :)

In this rpm, we found file /etc/cron.hourly/ocsinventory-agent, but we have 400 servers and they send at the same times reporting. On virtual infrastructure, maybe it can cause I/O storm.

Second problem, we want just execute 1 time by day so I'm thinking of doing something like this:

- remove file /etc/cron.hourly/ocsinventory-agent (but what if we update the package? I haven't looked at the spec file details yet).

-create a cron with execution window from 0AM to 7 AM each days with random value:

cat << EOF >> /etc/cron.d/ocsinventory-agent

source /etc/sysconfig/ocsinventory-agent

$(($RANDOM*59/32767)) $(($RANDOM*6/32767)) * * * root  /usr/bin/ocsinventory-agent --tag=${OCSTAG[0]} --lazy --nolocal --server=${OCSSERVER[0]}

EOF

Have you another solution about that?

Thank you for your feedback, and sorry for my poor english :P

in OCS Inventory NG agent for Unix by (160 points)
reshown by

1 Answer

+1 vote
 
Best answer
I think the solution you found is perfect

perhaps you can also use anachron with the parameter RANDOM_DELAY

https://www.thegeekdiary.com/centos-rhel-anacron-basics-what-is-anacron-and-how-to-configure-it/

Kind regards
by (17.9k points)
selected by
 
Powered by Question2Answer
...