Flex yaml file calling bash shell script returning "context deadline exceeded"

Hi NR,
I have a simple flex yaml file which merely calls a bash shell script which check the contents of certain files in a Samba/CIFS mounted filesystem and echo’s JSON output to stdout for Flex to read. It does this fine for mounted FS which contains up to 30 files. But for other mounted FS where up to 1000 files it seems to have a problem.

When I run the bash shell script via command line, it takes anywhere between 3 to 4 mins to complete for mounted FS which has roughly 1000 files.

When running the flex in debug mode, after few seconds, it seems to return this:

DEBU[0010] command: failed context_err=“context deadline exceeded” err=“signal: killed” exec="/home/admin/dumpfilecnt.sh /mnt/dump/server1" suggestion=“if you are handling this error case, ignore”

I had specified timeout of 5 min in the yaml file, but don’t think this helps. Any ideas?

My flex yaml file here:

integrations:

  • name: nri-flex
    interval: 10m
    timeout: 5m
    config:
    name: DumpFileCount
    variable_store:
    pathname: /mnt/dump/server1
    apis:
    - name: DumpFileCount
    event_type: dump_server1
    commands:
    - run: >-
    /home/admin/dumpfilecnt.sh ${var:pathname}

I figured it out! So under the “commands” section you add the timeout but in milliseconds:


integrations:

  • name: nri-flex
    interval: 10m
    timeout: 5m
    config:
    name: DumpFileCount
    variable_store:
    pathname: /mnt/dump/server
    apis:
    - name: DumpFileCount
    event_type: dump_server
    commands:
    - name: filecountscript
    timeout: 300000
    run: >-
    /home/userA/dumpfilecnt.sh ${var:pathname}
1 Like

Why is this the only place I’ve found this exceedingly useful information? Here I am expecting the ‘timeout’ on the integration to be meaningful.

Hi, @tony.massa: It is in the Flex integration docs, here: https://github.com/newrelic/nri-flex/blob/master/docs/apis/commands.md#Configurationproperties.