Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Perfdata files are staying in spool and not moved to directories

  1. #1

    Perfdata files are staying in spool and not moved to directories

    Hi,

    On my Shinken install, I configured pnp4nagios but I meet a problem.
    The files are staying in /usr/local/pnp4nagios/var/spool and not moved under directories (called with the name of the host) in /usr/local/pnp4nagios/var/perfdata.

    For example:
    ls /usr/local/pnp4nagios/var/spool
    perfdata.1314262109 perfdata.1314342302 perfdata.1314422677 perfdata.1314502912 perfdata.1314583121 perfdata.1314662128 perfdata.1314787550
    perfdata.1314262124 perfdata.1314342323 perfdata.1314422694 perfdata.1314502927 perfdata.1314583136 perfdata.1314662143 perfdata.1314787567

    I'm a little bit confused about pnp and the role of npcd and how it works on my previous Nagios.
    Do I have to add these lines below on my nagios.cfg?

    host_perfdata_file=/usr/local/pnp4nagios/var/host-perfdata
    host_perfdata_file_template=DATATYPE::HOSTPERFDATA \tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDA TA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCO MMAND$\tHOSTSTATE::$HOSTSTATE\
    $\tHOSTSTATETYPE::$HOSTSTATETYPE$
    host_perfdata_file_mode=a
    host_perfdata_file_processing_interval=15
    host_perfdata_file_processing_command=process-host-perfdata-file

    For the template of my hosts, do I have to add these one?
    define command{
    command_name process-service-perfdata-file
    command_line /bin/mv /usr/local/pnp4nagios/var/service-perfdata /usr/local/pnp4nagios/var/spool/service-perfdata.$TIMET$
    }

    define command{
    command_name process-host-perfdata-file
    command_line /bin/mv /usr/local/pnp4nagios/var/host-perfdata /usr/local/pnp4nagios/var/spool/host-perfdata.$TIMET$
    }

    define host {
    name host-pnp
    process_perf_data 1
    action_url /pnp4nagios/graph?host=$HOSTNAME$&srv=_HOST_' target='main' class='tips' rel='/pnp4nagios/popup?host=$HOSTNAME$&srv=_HOST_
    register 0
    }

    Thank you very much for answers!

    Regards,
    Gauthier


  2. #2
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,131

    Re: Perfdata files are staying in spool and not moved to directories

    Hi,

    In fact there is a NPCD module for the broker taht will manage all of this, without using the npcd from PNP4 package. All you need it to enable the NPCD module for your broker like. Cf the example at:
    http://www.shinken-monitoring.org/wiki/use_with_pnp

    No direct support by personal message. Please open a thread so everyone can see the solution

  3. #3

    Re: Perfdata files are staying in spool and not moved to directories

    Hum ok.

    If I well understood, what I need to do:
    1) Install/compile pnp4nagios (not in bulk mode)
    2) define in my shinken-specific.cfg:
    define module{
    module_name NPCD
    module_type npcdmod
    config_file /usr/local/pnp4nagios/etc/npcd.cfg
    }
    3) define in my shinken-specific.cfg:
    define broker{
    broker_name broker-master
    address isp-inf-03-vm
    port 7772
    spare 0
    realm All
    manage_sub_realms 1
    manage_arbiters 1
    modules Status-Dat, Simple-log, NPCD, Livestatus
    }
    4) in my templates of objects:
    define host {
    name host-pnp
    process_perf_data 1
    action_url /pnp4nagios/graph?host=$HOSTNAME$&srv=_HOST_' target='main' class='tips' rel='/pnp4nagios/popup?host=$HOSTNAME$&srv=_HOST_
    register 0
    }

    Am I right?

    I enable log on npcd.cfg on -1 to get debug but the log file is empty.
    I think shinken is creating perfdata because my spool contains a lot of perfdata files, but nothing is created in perfdata directory.
    Moreover, there is no /var/run/npcd.pid file.

    Thanks for your help

  4. #4

    Re: Perfdata files are staying in spool and not moved to directories

    Hi,

    I saw on the broker.log this error:
    Error : the instance Host-Perfdata-Autogenerated raised an exception [Errno 21] Is a directory: u'/usr/local/pnp4nagios/var/host-perfdata', I remove it!

    I will check what's wrong in my config.
    Any idea?

    Regards,
    Gauthier

  5. #5
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,131

    Re: Perfdata files are staying in spool and not moved to directories

    Yes, the arbiter generate a broker module for you if you configure your host-template file. Remove or comment this line in the nagios.cfg file and you will get away from this
    No direct support by personal message. Please open a thread so everyone can see the solution

  6. #6

    Re: Perfdata files are staying in spool and not moved to directories

    Hi,

    Thank you for your answer.
    I removed these lines in my nagios.cfg:
    Code:
    host_perfdata_file=/usr/local/pnp4nagios/var/host-perfdata
    host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$
    host_perfdata_file_mode=a
    host_perfdata_file_processing_interval=15
    host_perfdata_file_processing_command=process-host-perfdata-file
    Now I didn't have the error messages I had previously.

    But I have still the directory /usr/local/pnp4nagios/var/spool with a lot of files and nothing in my perfdata directory.

    I checked my config and now I have only:
    Code:
    define host {
      name    host-pnp
      process_perf_data 1
      action_url /pnp4nagios/graph?host=$HOSTNAME$&srv=_HOST_' target='main' class='tips' rel='/pnp4nagios/popup?host=$HOSTNAME$&srv=_HOST_                     
      register  0
    }
    
    define service {
      name    service-pnp
      process_perf_data 1
      action_url /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$' target='main' class='tips' rel='/pnp4nagios/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
      register  0
    }
    And my hosts and services are using these template.

    I'm think I'm forgetting something but what?

    Thank you,
    Gauthier

  7. #7
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,131

    Re: Perfdata files are staying in spool and not moved to directories

    And the Broker got the PNP module enabled? Look at the broker.log and see if this module is loaded, and didn't crashed
    No direct support by personal message. Please open a thread so everyone can see the solution

  8. #8

    Re: Perfdata files are staying in spool and not moved to directories

    I would say yes. My config for the brokers:

    Code:
    define broker{
        broker_name   broker-master
        (...)
        modules      Status-Dat, Simple-log, NPCD, Livestatus
        }
    
    define broker{
        broker_name   broker-slave
        (...)
        modules      Status-Dat, Simple-log, NPCD, Livestatus
        }
    And in the broker log, I got:
    Code:
    2011-09-06 08:45:12,223 [1315291512] [broker-master] Trying to init module : NPCD
    
    2011-09-06 08:45:12,224 [1315291512] [broker-master] Starting external module NPCD
    
    2011-09-06 08:45:12,225 [1315291512] [broker-master] Starting external process for instance NPCD
    
    2011-09-06 08:45:12,231 [1315291512] [broker-master] NPCD is now started ; pid=13075
    But I maybe found what could be wrong.
    My perfdata are configured like that
    define module{
    module_name Service-Perfdata
    module_type service_perfdata
    path service-perfdata
    }

    And it should maybe be: /usr/local/pnp4nagios/var/perfdata ?

    What do you think?
    Is there way to enable debug on pnp module?a
    Gauthier

  9. #9
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,131

    Re: Perfdata files are staying in spool and not moved to directories

    hi,

    there should be no Service-Perfdata here, but it's not called by the broker, so it's not a problem

    You can launch the broker in debug mode so :
    /etc/init.d/shinken-broker -d restart

    You will get a /tmp/broker.debug file so we can see what this module is really doing
    No direct support by personal message. Please open a thread so everyone can see the solution

  10. #10

    Re: Perfdata files are staying in spool and not moved to directories

    Hi,

    What I see in log of brokerd.log:
    Code:
    2011-09-06 11:29:51,752 [1315301391] [broker-master] A module is asking me to get all initial data from the scheduler 0
    
    2011-09-06 11:29:52,766 [1315301392] [broker-master] [broker-master] Connexion OK to the scheduler scheduler-master
    And what I see in broker-debug.log
    Code:
    shutdown socket 29
    Creating config: 0 {'program_start': 1315299276, 'process_performance_data': True, 'pid': 14114, 'passive_service_checks_enabled': True, 'event_handlers_enabled': True, 'daemon_mode': 1, 'global_host_event_handler': '', 'instance_name': u'scheduler-master', 'modified_host_attributes': 0, 'check_external_commands': True, 'failure_prediction_enabled': 0, 'modified_service_attributes': 0, 'last_alive': 1315301329, 'flap_detection_enabled': True, 'obsess_over_hosts': False, 'global_service_event_handler': '', 'check_service_freshness': True, 'obsess_over_services': False, 'instance_id': 0, 'notifications_enabled': True, 'is_running': 1, 'check_host_freshness': True, 'last_command_check': 1315301329, 'last_log_rotation': 1315301329, 'passive_host_checks_enabled': True, 'command_file': u'rw/nagios.cmd', 'active_service_checks_enabled': True, 'active_
     asking me to get all initial data from the scheduler 0
    Begin Loop : manage broks 0
    [broker-master] New running id for the scheduler scheduler-master : 1315299276.0 (was 0)
    [broker-master] I ask for a broks generation to the scheduler scheduler-master
    [broker-master] Connexion OK to the scheduler scheduler-master
    Begin Loop : manage broks 0
    Begin Loop : manage broks 0
    1315301276 DBG: the arbiter ask me what I manage. It's [0]
    Begin Loop : manage broks 0
    Begin Loop : manage broks 0
    Begin Loop : manage broks 0
    Adding in queue an external command {'__module__': 'shinken.external_command', 'my_type': 'externalcommand', '__init__': <function __init__ at 0x2a9dde8>, '__doc__': None}
    Begin Loop : manage broks 0
    Begin Loop : manage broks 1
    Begin Loop : manage broks 0
    {'_type': 'NeedData', '_data': {'full_instance_id': 0}, '_from': 0}
    A module is asking me to get all initial data from the scheduler 0
    Begin Loop : manage broks 0
    [broker-master] New running id for the scheduler scheduler-master : 1315299276.0 (was 0)
    [broker-master] I ask for a broks generation to the scheduler scheduler-master
    [broker-master] Connexion OK to the scheduler scheduler-master
    Begin Loop : manage broks 0
    Begin Loop : manage broks 0
    Adding in queue an external command {'__module__': 'shinken.external_command', 'my_type': 'externalcommand', '__init__': <function __init__ at 0x2a9dde8>, '__doc__': None}
    Begin Loop : manage broks 0
    Begin Loop Generating objects file!
    Generating status file!
    Generating status file!
    Generating status file!
    Generating status file!
    Generating status file!
    Generating status file!
    Generating objects file!
    connection 28 is idle since 0 seconds (waiting)
    
    connection 30 is idle since 0 seconds (idle)
    
    [Errno 107] Transport endpoint is not connected
    closed socket 30
    connection 30 is idle since 0 seconds (idle)
    
    connection 30 is idle since 0 seconds (idle)
    
    shutdown socket 30
    Creating config: 0 {'program_start': 1315299276, 'process_performance_data': True, 'pid': 14114, 'passive_service_checks_enabled': True, 'event_handlers_enabled': True, 'daemon_mode': 1, 'global_host_event_handler': '', 'instance_name': u'scheduler-master', 'modified_host_attributes': 0, 'check_external_commands': True, 'failure_prediction_enabled': 0, 'modified_service_attributes': 0, 'last_alive': 1315301392, 'flap_detection_enabled': True, 'obsess_over_hosts': False, 'global_service_event_handler': '', 'check_service_freshness': True, 'obsess_over_services': False, 'instance_id': 0, 'notifications_enabled': True, 'is_running': 1, 'check_host_freshness': True, 'last_command_check': 1315301392, 'last_log_rotation': 1315301392, 'passive_host_checks_enabled': True, 'command_file': u'rw/nagios.cmd', 'active_service_checks_enabled': True, 'active_host_checks_enabled': True}
    Creating config: 0 {'program_start': 1315299276, 'process_performance_data': True, 'pid': 14114, 'passive_service_checks_enabled': True, 'event_handlers_enabled': True, 'daemon_mode': 1, 'global_host_event_handler': '', 'instance_name': u'scheduler-master', 'modified_host_attributes': 0, 'check_external_commands': True, 'failure_prediction_enabled': 0, 'modified_service_attributes': 0, 'last_alive': 1315301454, 'flap_detection_enabled': True, 'obsess_over_hosts': False, 'global_service_event_handler': '', 'check_service_freshness': True, 'obsess_over_services': False, 'instance_id': 0, 'notifications_enabled': True, 'is_running': 1, 'check_host_freshness': True, 'last_command_check': 1315301454, 'last_log_rotation': 1315301454, 'passive_host_checks_enabled': True, 'command_file': u'rw/nagios.cmd', 'active_service_checks_enabled': True, 'active_host_checks_enabled': True}
    outputformat json
    DURATION 0.0038s
    connection 28 is idle since 0 seconds (idle)
    What can/should I conclude?

    Gauthier

Posting Permissions

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