Announcement

Collapse
No announcement yet.

Sudo error while generating files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sudo error while generating files

    Hi there
    I'm getting this error while generating the config files.
    usage: sudo -h | -K | -k | -L | -V
    usage: sudo -v [-AknS] [-p prompt]
    usage: sudo -l[l] [-AknS] [-g groupname|#gid] [-p prompt] [-U username] [-u username|#uid] [-g groupname|#gid] [command]
    usage: sudo [-AbEHknPS] [-r role] [-t type] [-C fd] [-g groupname|#gid] [-p prompt] [-u username|#uid] [-g groupname|#gid] [VAR=value] [-i|-s] [<command>]
    usage: sudo -e [-AknS] [-r role] [-t type] [-C fd] [-g groupname|#gid] [-p prompt] [-u username|#uid] file ...

    I enabled debug everything in main.cfg but cannot trace where is the ofending command.

    Any help to trace this issue appreciated
    Thanks in advance
    Regards.

  • #2
    Hello,

    Which version of Centreon.
    Can you paste your centreon sudoers file ?

    Regards.
    /!\Pas de support en message privé - No support in private message/!\

    "Il se faut entraider, c'est la loi de la nature." © Jean de La Fontaine

    Comment


    • #3
      Originally posted by Shini View Post
      Hello,

      Which version of Centreon.
      Can you paste your centreon sudoers file ?

      Regards.
      yes sure.

      centreon-www-2.4.1-fan.1
      centreon-www-2.4.5-fan.1
      centreon-trap-2.4.5-fan.1
      centreon-database-2.4.5-fan.1
      centreon-plugins-2.4.5-fan.1
      centreon-storage-2.4.5-fan.1
      pear-centreon-0.2-fan.1
      centreon-core-2.4.5-fan.1

      sudo version just in case
      sudo-1.7.2p1-29.el5_10

      sudoers
      Defaults requiretty

      Defaults !visiblepw
      Defaults logfile=/var/log/sudo.log
      Defaults env_reset
      Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR \
      LS_COLORS MAIL PS1 PS2 QTDIR USERNAME \
      LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION \
      LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC \
      LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS \
      _XKB_CHARSET XAUTHORITY"

      root ALL=(ALL) ALL







      User_Alias CENTREON=apache,nagios
      Defaults:CENTREON !requiretty
      CENTREON ALL = NOPASSWD: /etc/init.d/nagios* restart
      CENTREON ALL = NOPASSWD: /etc/init.d/nagios restart
      CENTREON ALL = NOPASSWD: /etc/init.d/nagios* reload
      CENTREON ALL = NOPASSWD: /etc/init.d/nagios reload
      CENTREON ALL = NOPASSWD: /usr/bin/nagios* -v *
      CENTREON ALL = NOPASSWD: /usr/bin/nagios -v *
      CENTREON ALL = NOPASSWD: /usr/bin/nagios* -s *
      CENTREON ALL = NOPASSWD: /usr/bin/nagios -s *
      CENTREON ALL = NOPASSWD: /etc/init.d/snmptrapd restart
      CENTREON ALL = NOPASSWD: /etc/init.d/snmptt restart
      CENTREON ALL = NOPASSWD: /etc/init.d/centstorage restart
      CENTREON ALL = NOPASSWD: /etc/init.d/centstorage stop
      CENTREON ALL = NOPASSWD: /etc/init.d/centstorage start
      CENTREON ALL = NOPASSWD: /etc/init.d/ndo2db* restart
      CENTREON ALL = NOPASSWD: /etc/init.d/ndo2db restart
      CENTREON ALL = NOPASSWD: /etc/init.d/ndo2db* reload
      CENTREON ALL = NOPASSWD: /etc/init.d/ndo2db reload

      Thanks for your time and support.
      regards

      Comment


      • #4
        Hello,

        Can you delete the duplicate lines with * caracters?

        Regards.
        /!\Pas de support en message privé - No support in private message/!\

        "Il se faut entraider, c'est la loi de la nature." © Jean de La Fontaine

        Comment


        • #5
          Originally posted by Shini View Post
          Hello,

          Can you delete the duplicate lines with * caracters?

          Regards.
          Yes:
          ## BEGIN: CENTREON SUDO
          #Add by CENTREON installation script
          User_Alias CENTREON=apache,nagios
          Defaults:CENTREON !requiretty
          # Monitoring engine Restart
          CENTREON ALL = NOPASSWD: /etc/init.d/nagios restart
          # Monitoring engine reload
          CENTREON ALL = NOPASSWD: /etc/init.d/nagios reload
          # Monitoring engine test config
          CENTREON ALL = NOPASSWD: /usr/bin/nagios -v *
          # Monitoring engine test for optim config
          CENTREON ALL = NOPASSWD: /usr/bin/nagios -s *
          # Snmptrapd Restart
          CENTREON ALL = NOPASSWD: /etc/init.d/snmptrapd restart
          # Snmptt restart
          CENTREON ALL = NOPASSWD: /etc/init.d/snmptt restart
          # CentStorage Restart
          CENTREON ALL = NOPASSWD: /etc/init.d/centstorage restart
          # CentStorage stop
          CENTREON ALL = NOPASSWD: /etc/init.d/centstorage stop
          # CentStorage start
          CENTREON ALL = NOPASSWD: /etc/init.d/centstorage start
          # Broker engine Restart
          CENTREON ALL = NOPASSWD: /etc/init.d/ndo2db restart
          # Broker engine reload
          CENTREON ALL = NOPASSWD: /etc/init.d/ndo2db reload
          ## END: CENTREON SUDO


          But still same error

          Comment


          • #6
            Originally posted by Shini View Post
            Hello,

            Can you delete the duplicate lines with * caracters?

            Regards.
            anyway, reading the logs, it seems that someone else did something dirty with the configuration:

            No RSA host key is known for 128.2.1.90 and you have requested strict checking.
            Host key verification failed.
            Use of uninitialized value in regexp compilation at /usr/share/centreon/bin/centcore line 592.
            No RSA host key is known for 128.2.1.90 and you have requested strict checking.
            Host key verification failed.
            2014-11-19 12:22:08 - Cannot get log file or log file doesn't exists on poller 1
            Use of uninitialized value in concatenation (.) or string at /usr/share/centreon/bin/centcore line 613.
            Use of uninitialized value in concatenation (.) or string at /usr/share/centreon/bin/centcore line 346.
            No RSA host key is known for 128.2.1.90 and you have requested strict checking.
            Host key verification failed.
            Use of uninitialized value in regexp compilation at /usr/share/centreon/bin/centcore line 592.
            No RSA host key is known for 128.2.1.90 and you have requested strict checking.
            Host key verification failed.
            2014-11-19 12:23:09 - Cannot get log file or log file doesn't exists on poller 1
            Use of uninitialized value in concatenation (.) or string at /usr/share/centreon/bin/centcore line 613.
            Use of uninitialized value in concatenation (.) or string at /usr/share/centreon/bin/centcore line 346.
            No RSA host key is known for 128.2.1.90 and you have requested strict checking.
            Host key verification failed.
            Use of uninitialized value in regexp compilation at /usr/share/centreon/bin/centcore line 592.
            No RSA host key is known for 128.2.1.90 and you have requested strict checking.
            Host key verification failed.
            2014-11-19 12:24:09 - Cannot get log file or log file doesn't exists on poller 1
            Use of uninitialized value in concatenation (.) or string at /usr/share/centreon/bin/centcore line 613.

            And what is more, now I tried to add a host and found that, if I add or remove one , its not reflected eventhough if I run the generate process without (-v debug ), the same number of hosts are displayed, this is no good, seems that the other sysadmin tried to add a poller or a new config.

            Any help on this appreciated.
            Regards

            Comment


            • #7
              Originally posted by Shini View Post
              Hello,

              Can you delete the duplicate lines with * caracters?

              Regards.
              I do not find this path "/usr/share/centreon/filesGeneration/nagiosCFG/1" in the default Nagios CFG 1 configuration, and I remember have seen it before and have it on my notes, maybe that's the problem.

              Thanks in advance.

              Comment


              • #8
                Did you realize SSH key exchange between your central server and your poller?
                /!\Pas de support en message privé - No support in private message/!\

                "Il se faut entraider, c'est la loi de la nature." © Jean de La Fontaine

                Comment


                • #9
                  Originally posted by Shini View Post
                  Did you realize SSH key exchange between your central server and your poller?
                  Yes, notices that, that seems to be what the other collegue was playing with, there is only one poller ( 128.2.1.90 ), the default which is running ( do not remember if it was 127.0.0.1 before ) , and a default nagios configuration, Nagios CFG 1 , is there a way to solve this issue from the centreon consoloe or should I re-genereate those keys from command line?


                  Thanks for your time and support.
                  Regards

                  Comment


                  • #10
                    Hello,

                    You need to re-export those keys from command line.

                    Regards.
                    /!\Pas de support en message privé - No support in private message/!\

                    "Il se faut entraider, c'est la loi de la nature." © Jean de La Fontaine

                    Comment


                    • #11
                      Originally posted by Shini View Post
                      Did you realize SSH key exchange between your central server and your poller?
                      Well, changing the default poller configuration to locahost, at least solved the sudo error!!!, now I have another errors related to configuration it seems which I'll have to take a look.

                      Reading configuration data...
                      Read main config file okay...
                      Error Template '' specified in service definition could not be not found (config file '/usr/share/centreon/filesGeneration/nagiosCFG/1/serviceTemplates.cfg', starting on line 44)
                      Error Template '' specified in service definition could not be not found (config file '/usr/share/centreon/filesGeneration/nagiosCFG/1/serviceTemplates.cfg', starting on line 209)
                      Error processing object config files!

                      Thanks you very much.

                      Comment


                      • #12
                        Solved

                        Lotta thanks to all of you.

                        Comment

                        Working...
                        X