2011-03-16 Dario Rodriguez <dario.rodriguez@artica.es>

* util/plugin/create_integria_incident.sh: Create script to create a new
	incident in Integria, this script could be used as an action in Pandora FMS.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4100 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
darode 2011-03-16 16:11:16 +00:00
parent 80ab60dac1
commit 29e29ec6dd
2 changed files with 96 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2011-03-16 Dario Rodriguez <dario.rodriguez@artica.es>
* util/plugin/create_integria_incident.sh: Create script to create a new
incident in Integria, this script could be used as an action in Pandora FMS.
2011-03-16 Dario Rodriguez <dario.rodriguez@artica.es>
* util/plugin/integria_plugin/,

View File

@ -0,0 +1,91 @@
#!/bin/bash
# Integria Plugin for Pandora FMS
# This plugin uses Integria API
# (c) Dario Rodriguez 2011
INTEGRIA_CONSOLE_PATH=""
USER=""
REQUEST="create_incident"
KEY=""
TITLE=""
DESC=""
PRIORITY=""
GROUP=""
INVENTORY=""
# Help menu
function help {
echo -e "Integria Plugin for Pandora FMS. http://pandorafms.com"
echo -e "Syntax:"
echo -e "\t\t-c : integria console path"
echo -e "\t\t-u : user"
echo -e "\t\t[-k] : API key (required if key is set on integria console)"
echo -e "\t\t-t : Indicent title"
echo -e "\t\t-d : Indicent description"
echo -e "\t\t-p : Indicent priority"
echo -e "\t\t-g : ID indicent group"
echo -e "\t\t-i : ID indicent inventory"
echo -e "Samples:"
echo " ./create_integria_incident.sh -c http://127.0.0.1/integria -u user -t \"Incident title\" -d \"Incident description\" -p 4 -g 5 -i 8"
echo ""
exit
}
# Show help if there is no parameters
if [ $# -eq 0 ]
then
help
fi
# Main parsing code
while getopts ":hc:u:k:t:d:p:g:i:" optname
do
case "$optname" in
"h")
help
;;
"c")
INTEGRIA_CONSOLE_PATH=$OPTARG
;;
"u")
USER=$OPTARG
;;
"k")
KEY=$OPTARG
;;
"t")
TITLE=$OPTARG
;;
"d")
DESC=$OPTARG
;;
"p")
PRIORITY=$OPTARG
;;
"g")
GROUP=$OPTARG
;;
"i")
INVENTORY=$OPTARG
;;
?)
help
;;
default)
help
;;
esac
done
# Create params for API call
PARAMS=$TITLE","$GROUP","$PRIORITY","$DESC","$INVENTORY
# Create API call
API_CALL=$INTEGRIA_CONSOLE_PATH"/include/api.php?user="$USER"&pass="$KEY"&op="$REQUEST"&params="$PARAMS
wget "$API_CALL" -o /dev/null -O /dev/null