Title: [opsview] [10004] Allow setting of opsview system uuid in script
- Revision
- 10004
- Author
- tvoon
- Date
- 2012-09-08 10:11:09 +0100 (Sat, 08 Sep 2012)
Log Message
Allow setting of opsview system uuid in script
Modified Paths
Modified: trunk/opsview-core/notifications/notify_by_ios_push
===================================================================
--- trunk/opsview-core/notifications/notify_by_ios_push 2012-09-07 16:59:57 UTC (rev 10003)
+++ trunk/opsview-core/notifications/notify_by_ios_push 2012-09-08 09:11:09 UTC (rev 10004)
@@ -20,9 +20,10 @@
use URI::Escape 'uri_escape';
# Change these if you don't have the notification profile set up in Opsview.
-my $ldap_username = '';
-my $ldap_password = '';
-my $proxy = '';
+my $opsview_system_uuid = '';
+my $ldap_username = '';
+my $ldap_password = '';
+my $proxy = '';
use vars qw( $pushserverip $dest_server );
@@ -45,9 +46,10 @@
'com.opsview.notificationmethods.iospush'
);
-$ldap_username ||= $notification_vars->{IOSPUSH_USERNAME};
-$ldap_password ||= $notification_vars->{IOSPUSH_PASSWORD};
-$proxy ||= $notification_vars->{IOSPUSH_PROXY};
+$opsview_system_uuid ||= $config_vars->{system}{uuid};
+$ldap_username ||= $notification_vars->{IOSPUSH_USERNAME};
+$ldap_password ||= $notification_vars->{IOSPUSH_PASSWORD};
+$proxy ||= $notification_vars->{IOSPUSH_PROXY};
my $alert_message =
uri_escape( $ENV{NAGIOS_HOSTNAME} . ':' . $ENV{NAGIOS_SERVICEOUTPUT} );
@@ -99,7 +101,7 @@
$url,
{
cmd => 'send_msg',
- uuid => $config_vars->{system}{uuid} || '',
+ uuid => $opsview_system_uuid,
username => $contact_name,
msg => $alert_message,
}
_______________________________________________
Opsview-checkins mailing list
[email protected]
http://lists.opsview.org/lists/listinfo/opsview-checkins