Page 1 of 2
Issue
Posted: Thu Jan 21, 2016 6:28 am
by raamardhani7
Hi Team,
While installing the script that is mentioned in the below URL
https://github.com/jsmroshamboot/NSNT/ I am facing the issue.
./sn_ticketer.pl
Can't locate SOAP/Lite.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./sn_ticketer.pl line 6.
BEGIN failed--compilation aborted at ./sn_ticketer.pl line 6.
Could you please advice. I have tried yum install SOAP::Lite, still having this issue.
Regards,
Ram.
Re: Issue
Posted: Thu Jan 21, 2016 12:01 pm
by lmiltchev
Try:
Let me know if this helped. Thank you!
Re: Issue
Posted: Fri Jan 22, 2016 1:11 am
by raamardhani7
lmiltchev wrote:Try:
Let me know if this helped. Thank you!
Hi lmiltchev,
Have installed soap as suggested.
Code: Select all
./sn_ticketer.pl
Can't locate Config/INI/Reader.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./sn_ticketer.pl line 7.
BEGIN failed--compilation aborted at ./sn_ticketer.pl line 7.
Code: Select all
head -10 sn_ticketer.pl
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
use SOAP::Lite;
use Config::INI::Reader;
use Config::IniFiles;
use Cwd 'abs_path';
use File::Basename;
Still I am facing the same issue. Could you please advise.
Re: Issue
Posted: Fri Jan 22, 2016 11:36 am
by tgriep
To install the required perl modules, login as root to the Nagios server and run the following commands.
Code: Select all
cpan install Config::INI::Reader
cpan install Config::IniFiles
cpan install File::Basename
cpan install XML::Simple
cpan install DBI
Read the prompts on the screen as you may have to install other prerequisites.
Re: Issue
Posted: Wed Jan 27, 2016 3:59 am
by raamardhani7
tgriep wrote:To install the required perl modules, login as root to the Nagios server and run the following commands.
Code: Select all
cpan install Config::INI::Reader
cpan install Config::IniFiles
cpan install File::Basename
cpan install XML::Simple
cpan install DBI
Read the prompts on the screen as you may have to install other prerequisites.
The above steps worked fine with us.
But someone can help me, how can the usage be?
Code: Select all
./sn_ticketer.pl --page="incident.do" --host="lusrcdnagiosxi00" --service="DOWN" --state="CRITICAL" --builddb --applypatches --buildmap
sn_ticketer version: v1.2 b190514
By John Murphy <[email protected]>, GNU GPL License
Usage: ./sn_ticketer.pl --page="<Service-now page>" [--host="<hostname>" --passive --<customargs> [--service="<service name>" --state="<nagios state>"]] [--builddb] [--applypatches] [--logrotate] [--buildmap]
--page
The page in the field map you wish to use for this alarm.
--host
The host that triggered this alarm, required when ticket track is enabled.
--service
Required option for ticket track to operate properly when the alarm is service related.
--state
The host/service state. Setting this is highly recommended when using ticket track otherwise it won't operate properly.
--passive
If this notification is related to passive data set this flag so that the ticket isn't kept alive.
--<customargs>
Customargs are defined by using the $$ symbols in the fieldmap file. Please see the readme for more details.
--builddb
Creates the database table required for ticket track operation.
--applypatches
Applies database and config file patches to ensure compatability with latest sn_ticketer version.
--logrotate
Create log rotate entry.
--buildmap
Generate the field mappings for a given Service-Now page.
--help
Display this help text.
Code: Select all
[root@lusrcdnagiosxi00 NSNT-master]# pwd
/usr/local/nagios/libexec/NSNT-master
[root@lusrcdnagiosxi00 NSNT-master]#
[root@lusrcdnagiosxi00 NSNT-master]# ll
total 76
-rwxrwxrwx 1 root root 1285 Jan 21 04:46 config.ini
-rwxrwxrwx 1 root root 941 May 23 2014 field_map.ini
-rwxrwxrwx 1 root root 18026 May 23 2014 LICENSE.md
-rwxrwxrwx 1 root root 13560 May 23 2014 README.md
-rwxrwxrwx 1 root root 28877 Jan 21 05:19 sn_ticketer.pl
Re: Issue
Posted: Wed Jan 27, 2016 5:05 pm
by tgriep
What you would have to do is 2 commands in Core Config Manager. One for host notifications and one for service notifications.
Here is a definition for the notify-host-by-snt
Code: Select all
define command { command_name notify-host-by-snt command_line $USER1$/NSNT-master/sn_ticketer.pl --page="incident.do" --host="$HOSTNAME$" --state="$HOSTSTATE$" --category="$_SERVICECATEGORY$" --subcategory="$_SERVICESUBCAT$" --priority="$_PRIORITY$" --group="$CONTACTALIAS$" --shortdesc="$HOSTNAME$ is $SERVICESTATE$" --desc="Host: $HOSTNAME$\nState: $HOSTSTATE$\nTime: $LONGDATETIME$\nDescription: $HOSTOUTPUT$\n\n" }
Here is a definition for the notify-service-by-snt
Code: Select all
define command { command_name notify-service-by-snt command_line $USER1$/NSNT-master/sn_ticketer.pl --page="incident.do" --host="$HOSTNAME$" --service="$SERVICEDESC$" --state="$SERVICESTATE$" --category="$_SERVICECATEGORY$" --subcategory="$_SERVICESUBCAT$" --priority="$_PRIORITY$" --group="$CONTACTALIAS$" --shortdesc="$SERVICEDESC$ on $HOSTNAME$ is $SERVICESTATE$" --desc="Host: $HOSTNAME$\nService: $SERVICEDESC$\nState: $SERVICESTATE$\nTime: $LONGDATETIME$\nDescription: $SERVICEOUTPUT$\n\n" $_SERVICEPASSIVE$ }
Then, you would edit the contact you want to receive the Service-Now notification and add the above to the host / service notification commands.
Re: Issue
Posted: Thu Jan 28, 2016 1:11 am
by raamardhani7
tgriep wrote:What you would have to do is 2 commands in Core Config Manager. One for host notifications and one for service notifications.
Here is a definition for the notify-host-by-snt
Code: Select all
define command { command_name notify-host-by-snt command_line $USER1$/NSNT-master/sn_ticketer.pl --page="incident.do" --host="$HOSTNAME$" --state="$HOSTSTATE$" --category="$_SERVICECATEGORY$" --subcategory="$_SERVICESUBCAT$" --priority="$_PRIORITY$" --group="$CONTACTALIAS$" --shortdesc="$HOSTNAME$ is $SERVICESTATE$" --desc="Host: $HOSTNAME$\nState: $HOSTSTATE$\nTime: $LONGDATETIME$\nDescription: $HOSTOUTPUT$\n\n" }
Here is a definition for the notify-service-by-snt
Code: Select all
define command { command_name notify-service-by-snt command_line $USER1$/NSNT-master/sn_ticketer.pl --page="incident.do" --host="$HOSTNAME$" --service="$SERVICEDESC$" --state="$SERVICESTATE$" --category="$_SERVICECATEGORY$" --subcategory="$_SERVICESUBCAT$" --priority="$_PRIORITY$" --group="$CONTACTALIAS$" --shortdesc="$SERVICEDESC$ on $HOSTNAME$ is $SERVICESTATE$" --desc="Host: $HOSTNAME$\nService: $SERVICEDESC$\nState: $SERVICESTATE$\nTime: $LONGDATETIME$\nDescription: $SERVICEOUTPUT$\n\n" $_SERVICEPASSIVE$ }
Then, you would edit the contact you want to receive the Service-Now notification and add the above to the host / service notification commands.
Hi Tom,
I wanted to execute it from XI server CLI, what arguments I need to pass. Please help me here, thanks.
Re: Issue
Posted: Thu Jan 28, 2016 9:39 am
by tgriep
Try running the command below but put in a valid name for "NameofService". It looks like this is all you need to run the command.
Code: Select all
./sn_ticketer.pl --page="incident.do" --host="lusrcdnagiosxi00" --service="NameofService" --state="CRITICAL"
Re: Issue
Posted: Mon Feb 29, 2016 10:35 am
by raamardhani7
Hi Team,
When I am running the below command, I am not finding the favorable results.. this is run under user nagios. but when i am running it with the root user, it is working fine.
Code: Select all
./sn_ticketer.pl
DBI object version 1.609 does not match bootstrap parameter 1.634 at /usr/lib64/perl5/DynaLoader.pm line 223.
BEGIN failed--compilation aborted at /usr/local/lib64/perl5/DBI.pm line 286.
Compilation failed in require at ./sn_ticketer.pl line 10.
BEGIN failed--compilation aborted at ./sn_ticketer.pl line 10.
Could you please help me here. thanks.
Re: Issue
Posted: Mon Feb 29, 2016 10:42 am
by tgriep
Can you login as root, run the following commands and post the output?
Code: Select all
ls -l /usr/share/perl5/
ls -l /usr/share/perl5/File/