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.11.1 available

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

ocsinventory-agent with daemon

Server: Debian 10.2 / ocsinventory-server 2.6.0
Client: OpenSuse Leap 15.1 / ocsinventory-agent 2.6.0 of repository:
https://build.opensuse.org/package/show/home:theophilegarin/ocsinventory-agent-v2.6

In French :

Bonjour à tous,

J'utilise OCS depuis maintenant 4 mois en production, tout est fonctionnel autant le déploiement que la remontée d'inventaire. Cependant sur mes postes Linux, j'aimerai lancer l'agent en tant que service, et non pas grace au cron, mais comment faire ?
J'ai vu dans le man-page qu'il fallait exécuter "ocsinventory-agent -d --scan-homedirs". A l'exécution, j'obtiens:

[debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.6.0
[debug] Log system initialised (Stderr)
[debug] Accountinfo file: /var/lib/ocsinventory-agent/https:__ocs.sirs-fr.com_ocsinventory/ocsinv.adm
[debug] Time to call Proc::Daemon

  1. Comment s'assurer que le service tourne bien ?
  2. Faut-il lancer le service "ocsinventory-agent -d --scan-homedirs" avec un cron au démarrage ?

Actuellement pour mon cron, j'édite avec "crontab -e" et je rentre:
@reboot sleep 30 ; /usr/sbin/ocsinventory-agent

Mais la méthode ne me semble pas vraiment bien. De plus je pense que cela pose certains problème de remonté des utilisateurs.

Une bonne fin d'année à tous.

In bad English:

Hello everyone,

I am using OCS since 4 months, everything's running well, the deploiement and pull up of inventory. However on my Linux computers, i would like to launch the ocsinventory-agent as daemon, and not with the cron, so how can i do this ?
I saw in the man-page, it was necessary to execute "ocsinventory-agent -d --scan-homedirs". At the execution, i get :

[debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.6.0
[debug] Log system initialised (Stderr)
[debug] Accountinfo file: /var/lib/ocsinventory-agent/https:__ocs.sirs-fr.com_ocsinventory/ocsinv.adm
[debug] Time to call Proc::Daemon

  1. How can i be sure of the service is working ?
  2. That is necessary to launch the daemon "ocsinventory-agent -d --scan-homedirs" with a cron at startup ?

Currently for my cron, i edit with "crontab -e" and i write:

@reboot sleep 30 ; /usr/sbin/ocsinventory-agent

But the method does not seem to me really good. Besides, i think this method give some problems like the pull up of users.

Have a good end of year everyone.

in OCS Inventory NG agent for Unix by (120 points)

1 Answer

0 votes

Bonjour,

  1. Pour être sûr que l'agent est bien lancé, il suffit de lancer la commande ps faux | grep -i ocsinventory et de vérifier la présence du fichier ocsinventory-agent.pid dans le répertoire /run.
  2. Il suffit de paramétrer le fichier de configuration de l'agent avec le paramètre daemon=1
Cordialement
Frank
by (88.5k points)
 
Powered by Question2Answer
...