Issue with Service now Integration

Hi All, I am trying to integrate service now with Sensu go. Sensu go is installed on ubuntu 14.04. I have added asset and created handler with below configuration

type: Handler
api_version: core/v2
metadata:
created_by: admin
name: IncidentMgmt
namespace: default
spec:
command: sensu-servicenow-handler --host --incidentTable incident --username --password
env_vars: null
filters:

  • is_incident
    handlers: null
    runtime_assets:
  • sensu/sensu-servicenow-handler
    secrets: null
    timeout: 0
    type: pipe

But I am getting below error in logs

{“check_name”:“check-dnsmasq-process”,“check_namespace”:“default”,“component”:“pipelined”,“entity_name”:“elk01”,“entity_namespace”:“default”,“event_id”:“ed160e3a-41a3-4bf5-9241-79db8477e5c4”
,“handler_name”:“IncidentMgmt”,“handler_namespace”:“default”,“level”:“info”,“msg”:“event pipe handler executed”,“output”:"2021/04/20 11:16:22 Configuration Item sys_id: \n2021/04/20 11:16:22
Looking for existing incident for elk01/check-dnsmasq-process\n2021/04/20 11:16:22 Get ServiceNow incident URL: https:///api/now/table/incident?sysparm_limit=1\u0026sys
parm_fields=sys_id\u0026sysparm_query=descriptionSTARTSWITHSensu+event+elk01%2Fcheck-dnsmasq-process%5EstateNOT+IN6%2C7\npanic: runtime error: index out of range [0] with length 0\n\

Please help

1 Like

It looks like you’re missing a --host configuration parameter. Your handler command field sets the --host flag but doesn’t provide a value (e.g. --host=servicenow.yourcompany.com), and the error is explaining that there’s a problem getting results from the URL: https:///api/now/table/incident.

I have added an issue to the private repo to improve the error logging here, but I would expect that providing the correct ServiceNow host details (a hostname or IP address) should resolve the issue.

I hope this helps!

Hi,

Actually I have given servicenow host name. I removed name while posting here. This is the url being called in logs

https://nsn03.service-now.com/api/now/table/incident?sysparm_limit=1\u0026sysparm_fields=sys_id\u0026sysparm_query=descriptionSTARTSWITHSensu+event+elk01%2Fcheck-dnsmasq-process^stateNOT+IN6%2C7

Where nsn03.service-now.com is Servicenow host name.

Issue is resolved now…I was missing handler tag in handler definition

1 Like

@Jyotsana_Srivastava I’m glad you figured it out!

We have also identified a related bug and a bugfix is coming soon (early next week at the latest). Stay tuned for a v2.2.0 release. :slightly_smiling_face:

Have a great weekend!

1 Like