Page 1 of 1

can't call method rows on an undefined value

Posted: Fri May 25, 2018 8:53 am
by jyoti22
Hi

I am trying to integrate Nagios with ServiceNow. I am using sn_ticketer.pl plugin.

After the alert is triggered on Nagiosxi, the incident is not getting triggered on ServiceNow.
I am getting an error "can't call method rows on an undefined value". in cd /usr/local/nagios/var/nagios.log.

I tried the suggestions in the post given below. commented lines for dbResults->rows.
https://support.nagios.com/forum/viewto ... 56&start=0

The incident gets created. But when the incident gets closed on service now, there is no way the archived value in the table sn_ticket_tracker gets updated. And when the alert is triggered from same host on same service the second time, it doesnt create new incident in service now.

How do I resolve the error "can't call method rows on an undefined value"

Thanks,
Beena

Re: can't call method rows on an undefined value

Posted: Fri May 25, 2018 12:20 pm
by scottwilkerson

Re: can't call method rows on an undefined value

Posted: Fri May 25, 2018 1:21 pm
by jyoti22
Thanks Scott for your reply
Yes I am followed the same document for the integration. I was able to populate data on field_map.ini.
But the next step fails to create the incident. The nagios.log is as follows

[1527271882] SERVICE NOTIFICATION: nagiosadmin;localhost;Service Status - ntpd;UNKNOWN;xi_service_notification_handler;● ntpd.service - Network Time Service
[1527271882] SERVICE NOTIFICATION: servicenow;localhost;Service Status - ntpd;UNKNOWN;notify-service-by-snt;● ntpd.service - Network Time Service
[1527271883] wproc: NOTIFY job 600 from worker Core Worker 4565 is a non-check helper but exited with return code 255
[1527271883] wproc: host=localhost; service=Service Status - ntpd; contact=servicenow
[1527271883] wproc: early_timeout=0; exited_ok=1; wait_status=65280; error_code=0;
[1527271883] wproc: stderr line 01: print() on closed filehandle LOG at /usr/local/nagios/libexec/sn_ticketer.pl line 659.
[1527271883] wproc: stderr line 02: Can't call method "rows" on an undefined value at /usr/local/nagios/libexec/sn_ticketer.pl line 55.
[1527271883] wproc: stdout line 01: Unable to open log file: Permission denied
[1527271883] wproc: stdout line 02: Cleaning up archived DB entries older than TTL
[1527271883] wproc: stdout line 03: Config loaded.
[1527271883] wproc: stdout line 04: Message hash for this alert is: bd00baf05c25c6d0c47830d1a804fcab

Re: can't call method rows on an undefined value

Posted: Fri May 25, 2018 3:41 pm
by scottwilkerson
Can you share you config.ini (blocking out sensitive info)

Thanks