shinken-monitoring / mod-named-pipe

Shinken module for listening external commands from a Unix named pipe (like Nagios)
GNU Affero General Public License v3.0
0 stars 3 forks source link

ERROR named-pipe #2

Open serge-marie opened 7 years ago

serge-marie commented 7 years ago

Bonjour,

J'essaye t'utiliser le module named-pipe mais j'ai l'erreur suivante :

Dans le /var/log/shinken/arbiterd.log :

[1484821982]` INFO: [Shinken] [named-pipe] Trying to open the named pipe '/var/lib/shinken/shinken.cmd' [1484821982] INFO: [Shinken] [named-pipe] The named pipe '/var/lib/shinken/shinken.cmd' is open [1484821982] INFO: [Shinken] [named-pipe] Trying to open the named pipe '/var/lib/shinken/shinken.cmd' [1484821982] INFO: [Shinken] [named-pipe] The named pipe '/var/lib/shinken/shinken.cmd' is open [1484821982] INFO: [Shinken] [named-pipe] Trying to open the named pipe '/var/lib/shinken/shinken.cmd' [1484821982] INFO: [Shinken] [named-pipe] The named pipe '/var/lib/shinken/shinken.cmd' is open [1484821982] ERROR: [Shinken] [named-pipe] Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/shinken/basemodule.py", line 164, in start_module self._main() File "/usr/lib/python2.7/site-packages/shinken/basemodule.py", line 296, in _main self.main() File "/var/lib/shinken/modules/named-pipe/module.py", line 133, in main ext_cmds = self.get() File "/var/lib/shinken/modules/named-pipe/module.py", line 91, in get buf = os.read(self.fifo, 8096) OSError: [Errno 11] Resource temporarily unavailable

[1484821983] ERROR: [Shinken] The external module named-pipe goes down unexpectedly! [1484821983] INFO: [Shinken] Setting the module named-pipe to restart [1484821983] INFO: [Shinken] Trying to init module: named-pipe [1484821983] INFO: [Shinken] I'm stopping module u'named-pipe' (pid=96632) [1484821983] INFO: [Shinken] Starting external process for instance named-pipe [1484821983] INFO: [Shinken] named-pipe is now started ; pid=37843 [1484821983] INFO: [Shinken] [named-pipe[37843]]: Now running.. [1484821983] INFO: [Shinken] [named-pipe] Trying to open the named pipe '/var/lib/shinken/shinken.cmd' [1484821983] INFO: [Shinken] [named-pipe] The named pipe '/var/lib/shinken/shinken.cmd' is open

D'avance merci

mohierf commented 7 years ago

Ca ressemble à un problème d'accès au fichier pipe utilisé. Vérifie que ta configuration est correcte dans le fichier de configuration du module et que tu as bien les droits d'accéder au fichier défini dans command_file

serge-marie commented 7 years ago

Bonjour,

En fait au démarrage de l'arbitre, le fichier pipe se crée bien mais au bout d'un moment le module crash....

J'ai essayé de modifier la taille du buffer mais cela ne fonctionne pas mieux.

Serge Le jeu. 19 janv. 2017 à 13:05, Frédéric MOHIER notifications@github.com a écrit :

Ca ressemble à un problème d'accès au fichier pipe utilisé. Vérifie que ta configuration est correcte dans le fichier de configuration du module et que tu as bien les droits d'accéder au fichier défini dans command_file

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shinken-monitoring/mod-named-pipe/issues/2#issuecomment-273759986, or mute the thread https://github.com/notifications/unsubscribe-auth/AO6OCDJ-WZoK9JDTFi7bxRR6pHIagtb8ks5rT1GJgaJpZM4Ln8RS .

mohierf commented 7 years ago

Je l'ai utilisé qu'en test ce module et j'ai jamais eu ce type de problème ...

La taille du buffer, comment tu as modifié ce truc ? C'est pas dans la conf ! Et ton shinken il est lancé en root ou pas? Il a bien les droits sur le fichier en question ?

serge-marie commented 7 years ago

Bah en fait je solicite pas mal le module via des external commmands

Pour la taille du buffer, j'ai essayé de modifier les lignes 91 et 93 du fichier "/app/list/shinken/lib/modules/named-pipe/module.py" qui sont : 91 : buf = os.read(self.fifo, 8096) 93 : fullbuf = len(buf) == 8096 and True or False

Mon shinken est en shinken sauf l'arbitre qui est en root

J'ai bien les droits sur le fichier fifo et j'arrive à injecter des commandes qui sont bien prises en compte.

Mais à un moment, il plante et indique ces lignes dans le log.

Serge

Le jeu. 19 janv. 2017 à 13:16, Frédéric MOHIER notifications@github.com a écrit :

Je l'ai utilisé qu'en test ce module et j'ai jamais eu ce type de problème ...

La taille du buffer, comment tu as modifié ce truc ? C'est pas dans la conf ! Et ton shinken il est lancé en root ou pas? Il a bien les droits sur le fichier en question ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shinken-monitoring/mod-named-pipe/issues/2#issuecomment-273762197, or mute the thread https://github.com/notifications/unsubscribe-auth/AO6OCErWYZGuwq-sQu1W6co5H-KyOH9Gks5rT1QXgaJpZM4Ln8RS .

mohierf commented 7 years ago

Désolé, mais je ne pourrai pas t'aider plus sur ce truc ... tu peux essayer de faire un try except OSError, ce qui évitera déjà de planter le module :)

serge-marie commented 7 years ago

Ok merci pour le tuyaux ! :)

Serge

Le jeu. 19 janv. 2017 à 15:14, Frédéric MOHIER notifications@github.com a écrit :

Désolé, mais je ne pourrai pas t'aider plus sur ce truc ... tu peux essayer de faire un try except OSError, ce qui évitera déjà de planter le module :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shinken-monitoring/mod-named-pipe/issues/2#issuecomment-273786281, or mute the thread https://github.com/notifications/unsubscribe-auth/AO6OCBmEZ-vqpmmneAzmvA5ROLIZTcTBks5rT2-qgaJpZM4Ln8RS .

serge-marie commented 7 years ago

Bonjour,

Je n'ai pas creusé le sujet avant mais pour le "try except OSError", cela serait dans le fichier "/app/list/shinken/lib/modules/named-pipe/module.py" ?

Car j'ai toujours ce comportement ...

Il faut dire que le fifo "/var/lib/shinken/shinken.cmd" doit absorber un gros volume de données.

D'avance merci.

Serge