----------- In createTicket-nagios.php ---------------------
1,
'classmap' => $aSOAPMapping,
)
);
$sDescription = 'The service '.$sService.' is in state '.$sServiceStatus;
$oRes = $oSoapClient->CreateIncidentTicket(
ITOP_USERNAME, /* login */
ITOP_PASSWORD, /* password */
$sDescription, /* Title */
$sInitial, /* Description */
new SOAPExternalKeySearch(array(new
SOAPSearchCondition('name', DEFAULT_CALLER_NAME))), /* caller */
new SOAPExternalKeySearch(array(new
SOAPSearchCondition('name', DEFAULT_ORGANIZATION_NAME))), /* customer */
new SOAPExternalKeySearch(array(new SOAPSearchCondition('name', DEFAULT_SERVICE_NAME))), /* Service */
new SOAPExternalKeySearch(array(new SOAPSearchCondition('name', DEFAULT_SERVICE_SUBCATEGORY))), /* Sub category */
'', /* product */
new SOAPExternalKeySearch(array(new SOAPSearchCondition('name', DEFAULT_WORKGROUP_NAME))), /* workgroup */
array(new SOAPLinkCreationSpec('FunctionalCI', array(new SOAPSearchCondition('name', $sHost)), array())), /* impacted cis */
DEFAULT_IMPACT, /* impact*/
DEFAULT_URGENCY /* urgency */
);
echo "\n";
print_r($oRes);
echo "\n";
if (DEBUG)
{
print "\n";
print "Request: \n".$oSoapClient->__getLastRequest()."\n";
print "Response: \n".$oSoapClient->__getLastResponse()."\n";
print "\n";
}
break;
default:
echo "Service State Type \"$sServiceStateType\" != \"HARD\". No action taken.\n";
}
}
?>
--------------------- in ndomod.cfg --------------------------------------------- # OUTPUT TYPE # This option determines what type of output sink the NDO NEB module # should use for data output. Valid options include: # file = standard text file # tcpsocket = TCP socket # unixsocket = UNIX domain socket (default)
# OUTPUT # This option determines the name and path of the file or UNIX domain # socket to which output will be sent if the output type option specified # above is "file" or "unixsocket", respectively. If the output type # option is "tcpsocket", this option is used to specify the IP address # of fully qualified domain name of the host that the module should
_# connect to for sending output.
# DATA PROCESSING OPTION # This option determines what data the NDO NEB module will process. # Do not mess with this option unless you know what you're doing!!!! # Read the source code (include/ndbxtmod.h) to determine what values # to use here. Values from source code should be OR'ed to get the # value to use here. A value of -1 will cause all data to be processed. # Read the source code (include/ndomod.h) and look for "NDOMOD_PROCESS" # to determine what values to use here. Values from source code should # be OR'ed to get the value to use here. A value of -1 will cause all
_# data to be processed.
data_processing_options=-1
# CONFIG OUTPUT OPTION # This option determines what types of configuration data the NDO # NEB module will dump from Nagios. Values can be OR'ed together. # Values: # 0 = Don't dump any configuration information # 1 = Dump only original config (from config files) # 2 = Dump config only after retained information has been restored # 3 = Dump both original and retained configuration
config_output_options=3
Last edit: FreemindFromSouth 2014-11-19
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear all,
I have checked all your topics about how to integrate nagios with ITOP but I am not able to find a solution of the following issue...
I have installed ITOP 2.0.3, which is working perfectly on a Windows server/apache
I have installed a Fully Automated Nagios Virtual Server / CentOS 5.9
Nagios is working fine and I can monitor my hosts & services.
I have followed the recommandations here and still nothing happen...
http://sourceforge.net/p/itop/discussion/1113906/thread/a676e8b1/?limit=25#249f
I can see the nagios status of my hosts in ITOP.
Could you please help me a bit in order to get incident ticket create in ITOP ?
__What should I do? I am a newbie with Linux, so I need explanation and commands. __
Thank you in advance for your help.
Nagios Configuration is as follows:
/etc/nagios/nagios.cfg
/etc/nagios/createTicket-nagios.php
/etc/nagios/objects/commands.cfg
/etc/nagios/ct-n.out file is EMPTY...
I inserted the following lines in configuration files:
----------- In nagios.cfg ---------------------
global_host_event_handler=create-iTop-ticket-h
global_service_event_handler=create-iTop-ticket-s
----------- In commands.cfg ---------------------
Commands to send incidents to iTop
# Create incident tickets in iTop command definition for service issues
define command{
command_name create-iTop-ticket-s
command_line /usr/bin/php /etc/nagios/createTicket-nagios.php "$HOSTNAME$" "$SERVICEDESC$" "$SERVICESTATE$" "$SERVICESTATETYPE$" "$SERVICEOUTPUT$ $LONGSERVICEOUTPUT$" >> /etc/nagios/ct-n.out
}
# Create incident tickets in iTop command definition for host issues
define command{
command_name create-iTop-ticket-h
command_line /usr/bin/php /etc/nagios/createTicket-nagios.php "$HOSTNAME$" "$HOSTALIAS$" "$HOSTSTATE$" "$HOSTSTATETYPE$" "$HOSTOUTPUT$ $LONGHOSTOUTPUT$" >> /etc/nagios/ct-n.out
}
----------- In createTicket-nagios.php ---------------------
1, 'classmap' => $aSOAPMapping, ) ); $sDescription = 'The service '.$sService.' is in state '.$sServiceStatus; $oRes = $oSoapClient->CreateIncidentTicket( ITOP_USERNAME, /* login */ ITOP_PASSWORD, /* password */ $sDescription, /* Title */ $sInitial, /* Description */ new SOAPExternalKeySearch(array(new SOAPSearchCondition('name', DEFAULT_CALLER_NAME))), /* caller */ new SOAPExternalKeySearch(array(new SOAPSearchCondition('name', DEFAULT_ORGANIZATION_NAME))), /* customer */ new SOAPExternalKeySearch(array(new SOAPSearchCondition('name', DEFAULT_SERVICE_NAME))), /* Service */ new SOAPExternalKeySearch(array(new SOAPSearchCondition('name', DEFAULT_SERVICE_SUBCATEGORY))), /* Sub category */ '', /* product */ new SOAPExternalKeySearch(array(new SOAPSearchCondition('name', DEFAULT_WORKGROUP_NAME))), /* workgroup */ array(new SOAPLinkCreationSpec('FunctionalCI', array(new SOAPSearchCondition('name', $sHost)), array())), /* impacted cis */ DEFAULT_IMPACT, /* impact*/ DEFAULT_URGENCY /* urgency */ ); echo "\n"; print_r($oRes); echo "\n"; if (DEBUG) { print "\n"; print "Request: \n".$oSoapClient->__getLastRequest()."\n"; print "Response: \n".$oSoapClient->__getLastResponse()."\n"; print "\n"; } break; default: echo "Service State Type \"$sServiceStateType\" != \"HARD\". No action taken.\n"; } } ?>--------------------- in ndomod.cfg ---------------------------------------------
# OUTPUT TYPE
# This option determines what type of output sink the NDO NEB module
# should use for data output. Valid options include:
# file = standard text file
# tcpsocket = TCP socket
# unixsocket = UNIX domain socket (default)
#output_type=file
output_type=tcpsocket
#output_type=unixsocket
# OUTPUT
# This option determines the name and path of the file or UNIX domain
# socket to which output will be sent if the output type option specified
# above is "file" or "unixsocket", respectively. If the output type
# option is "tcpsocket", this option is used to specify the IP address
# of fully qualified domain name of the host that the module should
_# connect to for sending output.
#output=/var/ndo.dat
output=127.0.0.1
#output=/var/ndo.sock
# DATA PROCESSING OPTION
# This option determines what data the NDO NEB module will process.
# Do not mess with this option unless you know what you're doing!!!!
# Read the source code (include/ndbxtmod.h) to determine what values
# to use here. Values from source code should be OR'ed to get the
# value to use here. A value of -1 will cause all data to be processed.
# Read the source code (include/ndomod.h) and look for "NDOMOD_PROCESS"
# to determine what values to use here. Values from source code should
# be OR'ed to get the value to use here. A value of -1 will cause all
_# data to be processed.
data_processing_options=-1
# CONFIG OUTPUT OPTION
# This option determines what types of configuration data the NDO
# NEB module will dump from Nagios. Values can be OR'ed together.
# Values:
# 0 = Don't dump any configuration information
# 1 = Dump only original config (from config files)
# 2 = Dump config only after retained information has been restored
# 3 = Dump both original and retained configuration
config_output_options=3
Last edit: FreemindFromSouth 2014-11-19
Is there anyone who can help me? Thks a lot
I think it's related to the ticket [#976]. Look at the ticket for the fix/patch.
Related
Tickets:
#976