Forum Discussion
eventSubsription testing
I have an eventsubscription ID by creating one with iControl. I have these events configured to send event notifications:
EVENTTYPE_INTERFACE
EVENTTYPE_NODE_ADDRESS
EVENTTYPE_VIRTUAL_SERVER
EVENTTYPE_POOL_MEMBER
EVENTTYPE_POOL
EVENTTYPE_RULE
EVENTTYPE_DELETE
EVENTTYPE_CREATE
EVENTTYPE_MODIFY
EVENTTYPE_SYSTEM_STARTUP
EVENTTYPE_SYSTEM_SHUTDOWN
EVENTTYPE_SYSTEM_CONFIG_LOAD
I have the URL setup
URL: http://10.10.1.30:8420
and the event handler running on the correct host. Is there an easy way to test one of these events? I assume that I could take a node down or something, but I was looking for something a little more programatic than that.
Thanks!
-jas
8 Replies
- Since you have EVENTTYPE_MODIFY set, you can just change an attribute of an object if you want. Edit a rule by adding a space or flip an attribute on a pool member and you should get a notification sent to you.
If you have troubles, you can verify your endpoint. In the SDK, there is a EventNotificationClient.pl perl script that you can run on your BIG-IP to test connections to your EventNotification listener.
Let us know how things go...
-Joe - jaskel_40663
Nimbostratus
Well, I went and started over, and it seems that it tests ok with the EventNotificationClient.pl script in the samples area. But I noticed that when I actually create the subscription withsub CreateSubscription {
my $name = "QA Subscription";
my @event_list = (
"EVENTTYPE_CREATE",
"EVENTTYPE_MODIFY",
"EVENTTYPE_DELETE",
"EVENTTYPE_INTERFACE",
"EVENTTYPE_POOL",
"EVENTTYPE_POOL_MEMBER",
"EVENTTYPE_RULE",
"EVENTTYPE_VIRTUAL_SERVER",
"EVENTTYPE_NODE_ADDRESS",
"EVENTTYPE_SYSTEM_STARTUP",
"EVENTTYPE_SYSTEM_SHUTDOWN",
"EVENTTYPE_SYSTEM_CONFIG_LOAD"
);
my $url = "http://10.10.1.30:8420";
my $url_cred =
{
auth_mode => "AUTHMODE_BASIC",
username => "admin",
password => "password"
};
my $ttl = -1;
my $min_event_per = 30;
my $max_time = 60;
my $enabled_state = "STATE_ENABLED";
my $total_detail =
{
name => $name,
event_type_list => [@event_list],
url => $url,
url_credentials => $url_cred,
ttl => $ttl,
min_events_per_timeslice => $min_event_per,
max_timeslice => $max_time,
enabled_state => $enabled_sate
};
my $soapResponse = $EventSub->create
(
SOAP::Data->name(sub_detail_list => [$total_detail])
);
if ($soapResponse->fault) {
print $soapResponse->faultcode," ",$soapResponse->faultstring,"\n";
exit();
}
else {
my @subStatus = @{$soapResponse->result};
foreach $stat (@subStatus) {
$code = $stat->{"code"};
$data = $stat->{"data"};
print "code: $code\n";
print "data: $data\n";
print "\n";
}
}
}
That it comes up as STATE_DISABLED, which seems to be the issue:
Getting subscription info
Details for subscription ID: 4936492D-1974-6E33-E4DC-52423273FE3
Name: QA Subscription
URL: http://10.10.1.30:8420
Enabled State: STATE_DISABLED
ID: 4936492D-1974-6E33-E4DC-52423273FE3
----EVENTS----
EVENTTYPE_INTERFACE
EVENTTYPE_NODE_ADDRESS
EVENTTYPE_VIRTUAL_SERVER
EVENTTYPE_POOL_MEMBER
EVENTTYPE_POOL
EVENTTYPE_RULE
EVENTTYPE_DELETE
EVENTTYPE_CREATE
EVENTTYPE_MODIFY
EVENTTYPE_SYSTEM_STARTUP
EVENTTYPE_SYSTEM_SHUTDOWN
EVENTTYPE_SYSTEM_CONFIG_LOAD
Not sure why that is so I'm still investigating.
-jaskel - jaskel_40663
Nimbostratus
I did create this subscription on the passive node in an HA pair? Would that maybe keep it in STATE_DISABLED instead of STATE_ENABLED, or does it not even care about that?
-James - Most likely is that its a communication error to your client. For help in debugging, you can run the server side eventd process in debug mode to list out the diagnostics. Ssh into your BIG-IP and issue the following statements:
$ bigstart shutdown eventd $ /usr/sbin/eventd -d -f -o
Then try to create your subscription. At that point you should see something on the console that indicates why it is disabling the subscription.
-Joe - Oh, and make sure to kill that process and issue another "bigstart start eventd" after you are finished B-).
-Joe - jaskel_40663
Nimbostratus
Ok, so...did that and this is what I got from the output:012d0001:6: eventd version 9.0.0.337.17 started
Configuration::load()
Entering Notification Thread...
processSOAPMessage()
ns: urn:iControl:Management/EventSubscription
name: create
Creating Consumer 49950D7C-1974-D8F6-EA11-87A2852662F
Saving Consumer list
start_transaction {
}
Received TRANSACTION!
modify {
db_variable {
db_variable_name "configsync.peerconfigtimeraw"
db_variable_transaction_id 44504
}
}
end_transaction {
}
start_transaction {
}
Received TRANSACTION!
modify {
db_variable {
db_variable_name "configsync.peerupdatedstatus"
db_variable_transaction_id 44505
}
}
end_transaction {
}
start_transaction {
}
Received TRANSACTION!
modify {
db_variable {
db_variable_name "configsync.peerconfigtimeraw"
db_variable_transaction_id 44506
}
}
end_transaction {
}
start_transaction {
}
Received TRANSACTION!
modify {
db_variable {
db_variable_name "configsync.peerupdatedstatus"
db_variable_value "1"
db_variable_transaction_id 44507
}
}
end_transaction {
}
start_transaction {
}
Received TRANSACTION!
modify {
db_variable {
db_variable_name "configsync.peerupdatedstatus"
db_variable_value "0"
db_variable_transaction_id 44508
}
}
end_transaction {
}
processSOAPMessage()
ns: urn:iControl:Management/EventSubscription
name: get_list
processSOAPMessage()
ns: urn:iControl:Management/EventSubscription
name: query
start_transaction {
}
Received TRANSACTION!
modify {
db_variable {
db_variable_name "configsync.peerconfigtimeraw"
db_variable_transaction_id 44509
}
}
end_transaction {
}
start_transaction {
}
Received TRANSACTION!
modify {
db_variable {
db_variable_name "configsync.peerupdatedstatus"
db_variable_transaction_id 44510
}
}
end_transaction {
}
start_transaction {
}
Received TRANSACTION!
modify {
db_variable {
db_variable_name "configsync.peerconfigtimeraw"
db_variable_transaction_id 44511
}
}
end_transaction {
}
start_transaction {
}
Received TRANSACTION!
modify {
db_variable {
db_variable_name "configsync.peerupdatedstatus"
db_variable_value "1"
db_variable_transaction_id 44512
}
}
end_transaction {
}
start_transaction {
}
Received TRANSACTION!
modify {
db_variable {
db_variable_name "configsync.peerupdatedstatus"
db_variable_value "0"
db_variable_transaction_id 44513
}
}
end_transaction {
}
start_transaction {
}
Received TRANSACTION!
modify {
db_variable {
db_variable_name "configsync.peerconfigtimeraw"
db_variable_transaction_id 44514
}
}
end_transaction {
}
start_transaction {
}
Received TRANSACTION!
modify {
db_variable {
db_variable_name "configsync.peerupdatedstatus"
db_variable_transaction_id 44515
}
}
end_transaction {
}
start_transaction {
}
Received TRANSACTION!
modify {
db_variable {
db_variable_name "configsync.peerconfigtimeraw"
db_variable_transaction_id 44516
}
}
end_transaction {
}
start_transaction {
}
Received TRANSACTION!
modify {
db_variable {
db_variable_name "configsync.peerupdatedstatus"
db_variable_value "1"
db_variable_transaction_id 44517
}
}
end_transaction {
}
start_transaction {
}
Received TRANSACTION!
modify {
db_variable {
db_variable_name "configsync.peerupdatedstatus"
db_variable_value "0"
db_variable_transaction_id 44518
}
}
end_transaction {
}
Still came up in STATE_DISABLED though.
-jaskel - Looks like a typo in the create code:
my $total_detail = { name => $name, event_type_list => [@event_list], url => $url, url_credentials => $url_cred, ttl => $ttl, min_events_per_timeslice => $min_event_per, max_timeslice => $max_time, enabled_state => $enabled_sate };
$enabled_sate is undefined and thus defaults to 0. The server will interpret this as the enum value 0 which equates to STATE_DISABLED. Change that to $enabled_state and that should get you going.
Hope this helps...
-Joe - jaskel_40663
Nimbostratus
Wow....nothing like a typo to make me feel like a total tool....Getting subscription info
Details for subscription ID: 4ABD1B7F-1974-A46B-5E59-CB4CEBCA430
Name: QA Subscription
URL: http://10.10.1.30:8420
Enabled State: STATE_ENABLED
ID: 4ABD1B7F-1974-A46B-5E59-CB4CEBCA430
----EVENTS----
EVENTTYPE_INTERFACE
EVENTTYPE_NODE_ADDRESS
EVENTTYPE_VIRTUAL_SERVER
EVENTTYPE_POOL_MEMBER
EVENTTYPE_POOL
EVENTTYPE_RULE
EVENTTYPE_DELETE
EVENTTYPE_CREATE
EVENTTYPE_MODIFY
EVENTTYPE_SYSTEM_STARTUP
EVENTTYPE_SYSTEM_SHUTDOWN
EVENTTYPE_SYSTEM_CONFIG_LOAD
Thanks for all the tips and help!
-jaskel
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com