Results 1 to 2 of 2

Thread: Problems with discovery on RHEL 6 with shinken 1.4.1 from Epel

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    9

    Problems with discovery on RHEL 6 with shinken 1.4.1 from Epel

    Hello,

    after I installed shinken 1.4.1 from epel the installation seems to work. At least the WebUI is up, I can see the localhost and the Shinken state is all green. So far, so good. I modified the /etc/shinken/resource.cfg:

    Code:
    $NMAPTARGETS$=localhost
    and run

    Code:
    shinken-discovery -o /etc/shinken/objects/discovery -c /etc/shinken/discovery.cfg -r nmap
    I get the following warnings and errors:

    Macros []
    Got macros []
    [1395401772] Info : [config] opening '/etc/shinken/discovery.cfg' configuration file
    [1395401772] Info : Processing object config file '/etc/shinken/discovery_rules.cfg'
    [1395401772] Info : Processing object config file '/etc/shinken/discovery_runs.cfg'
    [1395401772] Info : Processing object config file '/etc/shinken/commands.cfg'
    [1395401772] Info : Processing object config file '/etc/shinken/resource.cfg'
    [1395401772] Warning : There is no arbiter, I add one in localhost:7770
    [1395401772] Warning : No scheduler defined, I add one at localhost:7768
    [1395401772] Warning : No poller defined, I add one at localhost:7771
    [1395401772] Warning : No reactionner defined, I add one at localhost:7769
    [1395401772] Warning : No broker defined, I add one at localhost:7772
    [1395401772] Warning : No realms defined, I add one at Default

    [1395401772] Info : Tagging Default-Poller with realm Default
    [1395401772] Info : Tagging Default-Broker with realm Default
    [1395401772] Info : Tagging Default-Reactionner with realm Default
    [1395401772] Info : Tagging Default-Scheduler with realm Default
    [1395401772] Info : Default: (in/potential) (schedulers:1) (pollers:1/1) (reactionners:1/1) (brokers:1/1) (receivers:0/0)
    ....
    [1395401772] Info : Checking commands...
    [1395401772] Error : [items] command.nmap_discovery is duplicated from /etc/shinken/commands.cfg
    [1395401772] Error : [items] command.vmware_esx_discovery is duplicated from /etc/shinken/commands.cfg
    [1395401772] Error : commands conf incorrect!!

    .....
    I'm launching nmap with a 3600 seconds timeout
    nmap Check 0 status:done command:/usr/lib64/nagios/plugins/discovery/nmap_discovery_runner.py --min-rate --max-retries -t localhost
    Error on run
    Got Raw disco data /bin/sh: /usr/lib64/nagios/plugins/discovery/nmap_discovery_runner.py: No such file or directory



    LOOPLOOPLOOPLOOPLOOPLOOPLOOPLOOPLOOPLOOP 1
    The problem is in principle that the command definitions for the runners are rejected as an error and because of that the nmap_discovery_runner.py is not found. I tried to work around this by linking the /usr/lib/shinken/plugins/discovery directory in the /usr/lib64/nagios/plugins directory so the file is found.

    Code:
    ln -s /usr/lib/shinken/plugins/discovery /usr/lib64/nagios/plugins
    When I retry now I don't get the error about No such file or directory. But the discovery is still hanging und I have to interupt manually.

    I'm launching nmap with a 3600 seconds timeout
    nmap Check 0 status:done command:/usr/lib64/nagios/plugins/discovery/nmap_discovery_runner.py --min-rate --max-retries -t localhost
    Error on run
    Got Raw disco data



    LOOPLOOPLOOPLOOPLOOPLOOPLOOPLOOPLOOPLOOP 1
    ^CTraceback (most recent call last):
    File "/usr/sbin/shinken-discovery", line 162, in <module>
    d.write_config()
    File "/usr/lib/python2.6/site-packages/shinken/discovery/discoverymanager.py", line 562, in write_config
    for name in self.disco_data:
    KeyboardInterrupt
    While I'm writing this post I see, that the parameters --min-rate --max-retries are empty

    Code:
    /usr/lib64/nagios/plugins/discovery/nmap_discovery_runner.py --min-rate --max-retries -t localhost
    A short investigation gives that the last four lines auf /etc/shinken/resource.cfg are missing. After inserting

    Code:
    # If your scans are to slow, try to increase minrate (number of packet in parallel
    # and reduce the number of retries
    $NMAPMINRATE$=1000
    $NMAPMAXRETRIES$=0
    from the git 1.4 branch I end up with

    I'm launching nmap with a 3600 seconds timeout
    nmap Check 0 status:done command:/usr/lib64/nagios/plugins/discovery/nmap_discovery_runner.py --min-rate 1000 --max-retries 0 -t localhost
    Error on run
    Got Raw disco data Got our target ['localhost']
    propose a tmppath /tmp/tmpgFdq6N
    Launching command, sudo nmap localhost -sU -sT --min-rate 1000 --max-retries 0 -T4 -O -oX /tmp/tmpgFdq6N
    Try to communicate
    Error: the nmap return an error: 'sudo: sorry, you must have a tty to run sudo
    '
    Why do I need sudo, I'm running this as root and by the way

    Code:
    sudo nmap localhost -sU -sT --min-rate 1000 --max-retries 0 -T4 -O -oX /tmp/tmpgFdq6N
    from the commandline runs fine (ok, my shell has a tty off course) and yields
    Starting Nmap 5.51 ( http://nmap.org ) at 2014-03-21 13:15 CET
    Nmap scan report for localhost (127.0.0.1)
    Host is up (0.000042s latency).
    Other addresses for localhost (not scanned): 127.0.0.1
    Not shown: 1995 closed ports
    PORT STATE SERVICE
    22/tcp open ssh
    25/tcp open smtp
    5555/tcp open freeciv
    50000/tcp open ibm-db2
    123/udp open ntp
    No exact OS matches for host (If you know what OS is running on it, see http://nmap.org/submit/ ).
    TCP/IP fingerprint:
    OS:SCAN(V=5.51%D=3/21%OT=22%CT=1%CU=2%PV=N%DS=0%DC=L%G=Y%TM=532C2D68% P=x86_
    OS:64-redhat-linux-gnu)SEQ(SP=104%GCD=1%ISR=107%TI=Z%CI=Z%II=I%TS=A)S EQ(SP=
    OS:104%GCD=2%ISR=107%TI=Z%CI=Z%II=I%TS=A)OPS(O1=M4 00CST11NW7%O2=M400CST11NW
    OS:7%O3=M400CNNT11NW7%O4=M400CST11NW7%O5=M400CST11 NW7%O6=M400CST11)WIN(W1=8
    OS:000%W2=8000%W3=8000%W4=8000%W5=8000%W6=8000)ECN (R=Y%DF=Y%T=40%W=8018%O=M
    OS:400CNNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F= AS%RD=0%Q=)T2(R=N)T3(R=N)
    OS:T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T5( R=Y%DF=Y%T=40%W=0%S=Z%A=S
    OS:+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=Z% F=R%O=%RD=0%Q=)T7(R=Y%DF=
    OS:Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF=N %T=40%IPL=164%UN=0%RIPL=G
    OS:%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40%C D=S)

    Network Distance: 0 hops

    OS detection performed. Please report any incorrect results at http://nmap.org/submit/ .
    Nmap done: 1 IP address (1 host up) scanned in 12.22 seconds
    This has been solved too by disabling the requiretty parameter in the /etc/sudoers file.

    Sorry about the lenghty post but what remains is the problem with the

    commands.cfg and resource.cfg files.

    Now I will check the generated configs.

    Kind regards

  2. #2
    Junior Member
    Join Date
    Mar 2014
    Posts
    9

    Re: Problems with discovery on RHEL 6 with shinken 1.4.1 from Epel

    Hello,

    I've now been able to track the last problems I had with the discovery so far. My workaraound with the symbolic link from /usr/lib/shinken/plugins/discovery to /usr/lib64/nagios/plugins is no longer needed. I had to adjust the /etc/shinken/discovery_runs.cfg by replacing the macro $PLUGINSDIR$ with the provided $USER1$ macro which point to the correct directory.

    Maybe someone can forward this to the maintainer of the rpms or just give me the contact that I can do that.

    Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •