Giter Club home page Giter Club logo

Comments (8)

ibmmqmet avatar ibmmqmet commented on August 25, 2024

This is nearly unreadable because of the formatting. And you don't seem to have provided a copy of your collector configuration file - that's the one with the definitions of how to connect to the queue manager.

The provided sample config has pollInterval = 30s. Problems with yaml files often revolve around trailing or missing spaces.

from mq-metric-samples.

kiranashav avatar kiranashav commented on August 25, 2024

Thank you for your reply..

Location of the file
[mqm@localhost mq_prometheus]$ ls
Channel Status-1573633353444.json Logging-1675415684512.json mq_prometheus.sh Queue Status-1542214350028.json z_OS status-1553086205889.json
config.collector.yaml main.go mq_prometheus.yaml README.md
config.go MQ Prometheus-1541759594068.json mqsf_prometheus.sh status.go
exporter.go mq_prometheus.mqsc Queue Manager Status-1554359901415.json Topic Status-1554454974410.json
[mqm@localhost mq_prometheus]$ pwd
/home/mqm/src/github.com/ibm-messaging/mq-metric-samples/cmd/mq_prometheus

Here's the config.collector.yaml file . Please let me know if you need any other file to fix the Invalid value for poll interval parameter

**config.collector.yaml** 


# This is the collector-specific piece of the configuration
prometheus:
  port: 9157
# We can constrain the http listener to a single adapter via the 'host' config. Default is
# to bind to all local addresses
# host: 1.2.3.4
  metricsPath: "/metrics"
  namespace: ibmmq
# We can also set keystore information if the Prometheus instance uses TLS to contact the collector
# httpsKeyFile:  "server.key"
# httpsCertFile: "server.crt"
# Keep running even if the qmgr is not available - allows a "STOPPED" status to be
# returned to the Prometheus server.
  keepRunning: true
# How often to check the status and to attempt to reconnect if there's been a failure  
  reconnectInterval: 5s

from mq-metric-samples.

kiranashav avatar kiranashav commented on August 25, 2024

the poll_interval seems to be defined in config.common.yaml. Not sure if we need to modify anything in this file

# This is the section of the configuration file
# that is common for all collectors. It gets combined
# with the collector-specific portion to create the real
# configuration file.

global:
  useObjectStatus: true
  useResetQStats: false
  usePublications: true
  logLevel: INFO 
  metaprefix: ""
  pollInterval: 30s
  rediscoverInterval: 1h
  tzOffset: 0h

connection:
    queueManager: QM1

# You can point at a CCDT here. You probably will have to use this
# for TLS client connections to a queue manager
    ccdtUrl:
# For simple client configurations, set the connName and channel
    connName:
    channel:
# If none of the channel-related attributes are set, then this can
# be set to true to force client connectivity and the usual environment
# variables such as MQSERVER are used.
    clientConnection: false

# If a user is set, then a password must be passed somehow. It can
# be done in this file, on a command line, or (better) passed via stdin
#    user: mqadmin
#    password: passw0rd                                             

# Which queue should be used as the template for replies from the qmgr. This will 
# usually be a QMODEL
    replyQueue: SYSTEM.DEFAULT.MODEL.QUEUE
# If 'replyQueue' is set to a QLOCAL, then you must also set
#   replyQueue2: A.DIFFERENT.QLOCAL

# Using durable subscriptions for queue metrics reduces the need for MAXHANDS to be increased.
# Setting this to a non-empty value switches the collectors to use durable subs. And then the
# replyQueue and replyQueue2 values MUST refer to distinct QLOCALs. The value of this attribute must be
# unique for any collector program connecting to this queue manager
    durableSubPrefix: 

# Maximum time (seconds) to wait for a status response from qmgr. 
    waitInterval: 3

# "channels" is for all the traditional MQ channels including SVRCONNs. "amqpChannels" shows
# status for the AMQP objects
objects:
    queues:
    - APP.*
    - "!SYSTEM.*"
    - "!AMQ.*"
    - QM*
    channels:
    - SYSTEM.*
    - TO.*
    topics:
    subscriptions:
#    amqpChannels:
#    - "*"

# The "filters" section gives additional control over what is collected for various
# object types. Some fields in here used to be in other sections, but those
# attributes now give an error to force configurations to move to this model.
filters:
    # Setting this to "true" reduces the unique sets of data in the database, at the cost of
    # hiding metrics from separate instances. 
    hideSvrConnJobname: false
    # Setting this to "true" shows all channels, not just those that have some kind of active status
    showInactiveChannels: false
    # Similar to the hideSvrJobname attribute, but for AMQP channels. Reduces the number of unique
    # elements when set to "true"
    hideAMQPClientId: false
    # The number of subscriptions can be reduced by selecting a subset of types. Set to "NONE" to 
    # ignore all published queue metrics (but still keeping all queue manager metrics). The set
    # shown here gives best balance for number of subscriptions and useful metrics. If this is an empty 
    # list, all queue metrics are collected.
    queueSubscriptionSelector:
    - PUT
    - GET
    - GENERAL

# Collector-specific configuration may also need to be added here. The example build
# scripts will concatenate default definitions from the cmd/mq_* directories.

from mq-metric-samples.

kiranashav avatar kiranashav commented on August 25, 2024

@ibmmqmet here's the docker command that I am executing. I have commented out the poll_interval in config.common.yaml
but we're still receiving the same error

[mqm@localhost` mq-metric-samples]$ sudo docker run -p 9157:9157 -v /home/mqm/src/github.com/ibm-messaging/mq-metric-samples/cmd/mq_prometheus:/opt/config -it --rm mqprom:2.0
IBM MQ metrics exporter for Prometheus monitoring
MQ Go Version : v5.5.0

ERRO[0000] Invalid value for poll interval parameter: time: invalid duration "" 
INFO[0000] Done.       

from mq-metric-samples.

ibmmqmet avatar ibmmqmet commented on August 25, 2024

It looks like you are only providing a partial configuration file (if any).

As the README says, the full config file that you supply needs to be the combination of config.common.yaml and the config.collector.yaml in a single file for the specific collector program.

from mq-metric-samples.

kiranashav avatar kiranashav commented on August 25, 2024

Hi @ibmmqmet We haven't made any changes to config.common.yaml and config.collector.yaml . Here's the list of directories which we currently have . I have shared both the files in the previous comments and still get the invalid value error. Not sure how to troubleshoot this issue. Any help on this issue would be appreciated.
Also here's the docker command I'm trying to execute .

Tried adding both config.common.yaml and config.collector.yaml in one single file and still getting the same error.

ERRO[0000] Invalid value for poll interval parameter: time: invalid duration "" 
INFO[0000] Done.       
sudo docker run -p 9157:9157 -v /home/mqm/src/github.com/ibm-messaging/mq-metric-samples/cmd/mq_prometheus:/opt/config -it --rm mqprom:2.0

[mqm@localhost mq-metric-samples]$ ls
CHANGELOG.md  config.common.yaml  DCO1.1.txt  Dockerfile.build  dspmqrtj                     go.mod  LICENSE      MQDEB  README.md  vendor
cmd           cp4i                Dockerfile  Dockerfile.run    go1.21.1.linux-amd64.tar.gz  go.sum  metrics.txt  pkg    scripts

from mq-metric-samples.

ibmmqmet avatar ibmmqmet commented on August 25, 2024

If you set loglevel to DEBUG it will print out what it thinks your configuration settings are. Of course, if you are pointing at the wrong configuration file then that change wouldn't take effect.

Since you seem to be mounting the prometheus-specific source directory into /opt/config, then it will be looking for a mq_prometheus.yaml from that directory. And that would have to be the merged /config.common.yaml and <cmd/mq_prometheus>/config.collector.yaml.

from mq-metric-samples.

kiranashav avatar kiranashav commented on August 25, 2024
@ibmmqmet As suggested above I have merged mq_prometheus.yaml with config.common.yaml and config.collector.yaml and executing the below command


[mqm@localhost ~]$ sudo docker run -p 9157:9157 -v /home/mqm/src/github.com/ibm-messaging/mq-metric-samples/cmd/mq_prometheus/mq_prometheus.yaml:/opt/config/mq_prometheus.yaml mqprom:2.0
[sudo] password for mqm: 
IBM MQ metrics exporter for Prometheus monitoring
MQ Go Version : v5.5.0

time="2023-10-13T09:21:17Z" level=error msg="Connection to QM1 has failed. Cannot connect to queue manager QM1 : MQCONNX: MQCC = MQCC_FAILED [2] MQRC = MQRC_Q_MGR_NAME_ERROR [2058]"
time="2023-10-13T09:21:17Z" level=info msg=Done.
[mqm@localhost ~]$ 

from mq-metric-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.