Tickets automatisch erzeugen lassen
Tickets automatisch erzeugen lassen
Hallo Zusammen,
gibt es eine Möglichkeit in OTRS z.B. über den GenericAgent ein Ticket automatisch zu erzeugen ?
Dies hat den Hintergrund das bei uns in der früh z.B. eine Updatekontrolle auf dem WSUS durchgeführt wird, die Logs der Firewall gecheckt werden usw. und hierfür soll immer ein Ticket erstellt werden.
Gruß Viva
gibt es eine Möglichkeit in OTRS z.B. über den GenericAgent ein Ticket automatisch zu erzeugen ?
Dies hat den Hintergrund das bei uns in der früh z.B. eine Updatekontrolle auf dem WSUS durchgeführt wird, die Logs der Firewall gecheckt werden usw. und hierfür soll immer ein Ticket erstellt werden.
Gruß Viva
OTRS-Version: 3.3.7
OTRS-Erweiterungen: KIX4OTRS
OS: Ubuntu Server 12.04.4 LTS
OTRS-Erweiterungen: KIX4OTRS
OS: Ubuntu Server 12.04.4 LTS
-
- Znuny newbie
- Posts: 64
- Joined: 17 Mar 2011, 12:07
- Znuny Version: 3.1.7
- Real Name: Michael Kohn
Re: Tickets automatisch erzeugen lassen
Hi,
die einfachste Möglichkeit ist IMHO Mails per Cronjob/Taskplaner ins Ticketsystem zu leiten.
die einfachste Möglichkeit ist IMHO Mails per Cronjob/Taskplaner ins Ticketsystem zu leiten.
OTRS 3.3.6 / FAQ 2.3.3 / ImportExport 3.3.5 / SystemMonitoring 2.5.3 / Support 1.5.4
OS: Debian 7 Wheezy / DB: MySQL 5.5 / Webserver: Apache 2.2
OS: Debian 7 Wheezy / DB: MySQL 5.5 / Webserver: Apache 2.2
Re: Tickets automatisch erzeugen lassen
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
-
- Znuny newbie
- Posts: 64
- Joined: 17 Mar 2011, 12:07
- Znuny Version: 3.1.7
- Real Name: Michael Kohn
Re: Tickets automatisch erzeugen lassen
Sehr interessanter Ansatz - habe ich mir direkt mal vorgemerkt

OTRS 3.3.6 / FAQ 2.3.3 / ImportExport 3.3.5 / SystemMonitoring 2.5.3 / Support 1.5.4
OS: Debian 7 Wheezy / DB: MySQL 5.5 / Webserver: Apache 2.2
OS: Debian 7 Wheezy / DB: MySQL 5.5 / Webserver: Apache 2.2
Re: Tickets automatisch erzeugen lassen
Danke für den Link !
Gruß Viva
Gruß Viva
OTRS-Version: 3.3.7
OTRS-Erweiterungen: KIX4OTRS
OS: Ubuntu Server 12.04.4 LTS
OTRS-Erweiterungen: KIX4OTRS
OS: Ubuntu Server 12.04.4 LTS
Re: Tickets automatisch erzeugen lassen
Blöde Frage aber wo müssen die beiden Dateien (create-ticket.pl und ical-daemon) hinkopiert werden?
OTRS-Version: 3.3.7
OTRS-Erweiterungen: KIX4OTRS
OS: Ubuntu Server 12.04.4 LTS
OTRS-Erweiterungen: KIX4OTRS
OS: Ubuntu Server 12.04.4 LTS
Re: Tickets automatisch erzeugen lassen
das sind stand alone scripte, Du kannst sie also hinkopieren wo Du willst 

"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Re: Tickets automatisch erzeugen lassen
Okay, ich hätte es mir so vorgestellt:
You do not have the required permissions to view the files attached to this post.
OTRS-Version: 3.3.7
OTRS-Erweiterungen: KIX4OTRS
OS: Ubuntu Server 12.04.4 LTS
OTRS-Erweiterungen: KIX4OTRS
OS: Ubuntu Server 12.04.4 LTS
Re: Tickets automatisch erzeugen lassen
da die Software kein lokales OTRS braucht ist es egal.. ich würde sie ausserhalb lassen um bei einem Update nicht in Gefahr zu kommen die Scripte zu verlieren
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Re: Tickets automatisch erzeugen lassen
Hallo jojo,
das ich dich jetzt nicht falsch verstehe, ich habe die .ics Dateien lokal auf dem OTRS Server liegen oder muss das über einen ICAL / CALDAV Server laufen ?
Gruß Viva
das ich dich jetzt nicht falsch verstehe, ich habe die .ics Dateien lokal auf dem OTRS Server liegen oder muss das über einen ICAL / CALDAV Server laufen ?
Gruß Viva
OTRS-Version: 3.3.7
OTRS-Erweiterungen: KIX4OTRS
OS: Ubuntu Server 12.04.4 LTS
OTRS-Erweiterungen: KIX4OTRS
OS: Ubuntu Server 12.04.4 LTS
Re: Tickets automatisch erzeugen lassen
die ics Dateien liegen lokal. Aber das Script muss nicht auf dem OTRS Server liegen, da es SOAP benutzt.
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Re: Tickets automatisch erzeugen lassen
Okay, dann passt das schon mal. Zum besseren Verständniss beschreibe ich mein aktuelles Vorgehen:
- SOAP Benutzerdaten unter Framework -> Core::SOAP aktiviert und aktualisiert nur hier wurden Benutzer und Passwort eingegeben nicht mehr unter C:\Program Files\OTRS\OTRS\bin\cgi-bin\rpc.pl
- Dauertermin in Microsoft Outlook angelegt und als .ics Datei gespeichert (exportiert)
- ical-daemon Paket heruntergeladen und unter C:\Program Files\OTRS\OTRS\ical-daemon auf einen Windows Server 2008 entpackt (siehe Bild oben) Konfiguration ist wie folgt
Inhalt create-ticket.pl
Inhalt ical-daemon wurde nicht angepasst
Inhalt .ics Testdatei
Dateien wie oben beschrieben liegen auf dem OTRS Server (wie im Bild weiter oben gezeigt)
Nur leider funktioniert das Script nicht, vielleicht habe ich auch etwas vergessen zu konfigurieren !?
Gruß Viva
- SOAP Benutzerdaten unter Framework -> Core::SOAP aktiviert und aktualisiert nur hier wurden Benutzer und Passwort eingegeben nicht mehr unter C:\Program Files\OTRS\OTRS\bin\cgi-bin\rpc.pl
- Dauertermin in Microsoft Outlook angelegt und als .ics Datei gespeichert (exportiert)
- ical-daemon Paket heruntergeladen und unter C:\Program Files\OTRS\OTRS\ical-daemon auf einen Windows Server 2008 entpackt (siehe Bild oben) Konfiguration ist wie folgt
Inhalt create-ticket.pl
Code: Select all
#!/usr/bin/perl -w
use SOAP::Lite( 'autodispatch', proxy => 'http://unser_Servername/otrs/rpc.pl' );
my($subject, $agenda, $queue, $time) = @ARGV;
my $SOAP_User = 'unser Soap User';
my $SOAP_Pass = 'unser Kennwort';
my $OTRS_Subject = $subject;
my $OTRS_Body = $agenda;
my $OTRS_CustomerFrom = 'feedback@otrs.org';
my $OTRS_Queue = $queue;
# script
my $RPC = Core->new();
# create a new ticket number
my $TicketNumber = $RPC->Dispatch( $SOAP_User, $SOAP_Pass, 'TicketObject', 'TicketCreateNumber' );
#print "NOTICE: New Ticket Number is: $TicketNumber\n";
# create a new ticket
my %TicketData = (
TN => $TicketNumber,
Title => $OTRS_Subject,
Queue => $OTRS_Queue,
Lock => 'unlock',
Priority => '3 normal',
State => 'new',
CustomerID => $OTRS_CustomerFrom,
CustomerUser => $OTRS_CustomerFrom,
OwnerID => 3,
UserID => 3,
);
my $TicketID = $RPC->Dispatch( $SOAP_User, $SOAP_Pass, 'TicketObject', 'TicketCreate', %TicketData => 1 );
#print "NOTICE: TicketID is $TicketID\n";
# create new article
my $ArticleID = $RPC->Dispatch($SOAP_User, $SOAP_Pass, 'TicketObject', 'ArticleCreate',
TicketID => $TicketID,
ArticleType => 'phone', # email-external|email-internal|phone|fax|...
SenderType => 'customer', # agent|system|customer
From => $OTRS_CustomerFrom, # not required but useful
To => $OTRS_Queue, # not required but useful
ReplyTo => $OTRS_CustomerFrom, # not required
Subject => $OTRS_Subject, # required
Body => $OTRS_Body, # required
Charset => 'utf-8',
HistoryType => 'PhoneCallCustomer', # EmailCustomer|Move|AddNote|PriorityUpdate|WebRequestCustomer|...
HistoryComment => 'Customer called us.',
UserID => 3,
NoAgentNotify => 0, # if you don't want to send agent notifications
MimeType => 'text/plain',
Loop => 0, # auto reject|auto follow up|auto follow up|auto remove
AutoResponseType => 'auto reply',
ForceNotificationToUserID => '',
OrigHeader => {
'From' => $OTRS_CustomerFrom,
'To' => $OTRS_Queue,
'Subject' => $OTRS_Subject,
'Body' => $OTRS_Body,
},
);
#print "NOTICE: ArticleID is $ArticleID\n";
exit 0;
Inhalt ical-daemon wurde nicht angepasst
Code: Select all
#!/usr/bin/perl -w
###########################################
# ical-daemon - Parse .ics files and send
# alerts on upcoming events.
# Mike Schilli, 2010 (m@perlmeister.com)
# modified by Jens Bothe (jb@otrs.org)
###########################################
use strict;
#use local::lib;
use iCal::Parser;
use Log::Log4perl qw(:easy);
use App::Daemon qw(daemonize);
use Sysadm::Install qw(mkd slurp tap);
use FindBin qw($Bin);
our $UPDATE_REQUESTED = 0;
our $ALERT_BEFORE =
DateTime::Duration->new( minutes => 15 );
our $CURRENT_DAY = DateTime->today();
our @TODAYS_EVENTS = ();
my($home) = glob "~";
my $admdir = "$home/.ical-daemon";
my $icsdir = "$admdir/ics";
mkd $admdir unless -d $admdir;
mkd $icsdir unless -d $icsdir;
$App::Daemon::logfile = "$admdir/log";
$App::Daemon::pidfile = "$admdir/pid";
if( exists $ARGV[0] and
$ARGV[0] eq '-q' ) {
my $pid = App::Daemon::pid_file_read();
kill 10, $pid; # Send USR1
exit 0;
}
Log::Log4perl->easy_init({
level => $DEBUG,
file => $App::Daemon::logfile
});
$SIG{ USR1 } = sub {
DEBUG "Received USR1";
$UPDATE_REQUESTED = 1;
};
$UPDATE_REQUESTED = 1; # bootstrap
daemonize();
while(1) {
my $now = DateTime->now(
time_zone => 'local' );
my $today =
$now->clone->truncate( to => 'day' );
if( $UPDATE_REQUESTED or
$CURRENT_DAY ne $today ) {
$UPDATE_REQUESTED = 0;
$CURRENT_DAY = $today;
DEBUG "Updating ...";
@TODAYS_EVENTS = update( $now );
DEBUG "Update done.";
}
if( scalar @TODAYS_EVENTS ) {
my $entry = $TODAYS_EVENTS[0];
DEBUG "Next event at: $entry->[0]";
if( $now >
$entry->[0] - $ALERT_BEFORE ) {
INFO "Notification: ",
"$entry->[1] $entry->[0]";
# tap "$Bin/ical-notify", $entry->[2], $entry->[1],
tap "$Bin/create-ticket.pl", $entry->[2], $entry->[1], $entry->[3],
$entry->[0];
shift @TODAYS_EVENTS;
next;
}
}
DEBUG "Sleeping";
sleep 60;
}
###########################################
sub update {
###########################################
my($now) = @_;
my $start = $now->clone->truncate(
to => 'day' );
my $tomorrow = $now->clone->add(
days => 1 );
my $parser=iCal::Parser->new(
start => $start,
end => $tomorrow );
my $hash;
for my $file (<$icsdir/*.ics>) {
DEBUG "Parsing $file";
$hash = $parser->parse( $file );
}
my $year = $now->year;
my $month = $now->month;
my $day = $now->day;
if(! exists $hash->{ events }->{
$year }->{ $month }->{ $day } ) {
return ();
}
my $events = $hash->{ events }->{
$year }->{ $month }->{ $day };
for my $key ( keys %$events ) {
if( event_is_holiday(
$events->{ $key } ) ) {
WARN "No alerts today (holiday)";
return ();
}
}
my @events = ();
for my $key ( keys %$events ) {
next if $now >
$events->{ $key }->{ DTSTART };
# already over?
push @events, [
$events->{ $key }->{ DTSTART },
$events->{ $key }->{ DESCRIPTION },
$events->{ $key }->{ SUMMARY },
$events->{ $key }->{ LOCATION },
];
}
@events = sort { $a->[0] <=> $b->[0] }
@events;
return @events;
}
###########################################
sub event_is_holiday {
###########################################
my($event) = @_;
return undef unless
exists $event->{ ATTENDEE };
if( $event->{ ATTENDEE }->[ 0 ]->{ CN }
eq "US Holidays" ) {
return 1;
}
return 0;
}
Code: Select all
BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
CLASS:PUBLIC
CREATED:20120807T202202Z
DESCRIPTION:\n
DTEND:20990807T040000Z
DTSTAMP:20120807T202202Z
DTSTART:20120807T040000Z
LAST-MODIFIED:20120807T202202Z
LOCATION:Pullach
PRIORITY:5
SEQUENCE:0
SUMMARY;LANGUAGE=de:Spamkontrolle
TRANSP:OPAQUE
UID:040000008200E00074C5B7101A82E00800000000A05F08438F74CD01000000000000000
0100000001BDF8B1A7ECD2441AB40680867F2F242
X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//E
N">\n<HTML>\n<HEAD>\n<META NAME="Generator" CONTENT="MS Exchange Server ve
rsion 08.00.0681.000">\n<TITLE></TITLE>\n</HEAD>\n<BODY>\n<!-- Converted f
rom text/rtf format -->\n\n<P DIR=LTR><SPAN LANG="de"></SPAN></P>\n\n</BOD
Y>\n</HTML>
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-DISALLOW-COUNTER:FALSE
X-MS-OLK-ALLOWEXTERNCHECK:TRUE
X-MS-OLK-AUTOFILLLOCATION:FALSE
X-MS-OLK-CONFTYPE:0
END:VEVENT
END:VCALENDAR
Nur leider funktioniert das Script nicht, vielleicht habe ich auch etwas vergessen zu konfigurieren !?
Gruß Viva
OTRS-Version: 3.3.7
OTRS-Erweiterungen: KIX4OTRS
OS: Ubuntu Server 12.04.4 LTS
OTRS-Erweiterungen: KIX4OTRS
OS: Ubuntu Server 12.04.4 LTS
Re: Tickets automatisch erzeugen lassen
da das Daemon Konzept unter Windows anders ist, kann es durchaus sein, das App::Daemon qw(daemonize); nicht funktioniert.
Wie bereits im Blog geschrieben ist das ganze ein Proof of concept und das wars.
Wie bereits im Blog geschrieben ist das ganze ein Proof of concept und das wars.
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com