One Hat Cyber Team
Your IP :
216.73.216.115
Server IP :
194.44.31.54
Server :
Linux zen.imath.kiev.ua 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Oct 3 14:30:23 UTC 2025 x86_64
Server Software :
Apache/2.4.37 (Rocky Linux) OpenSSL/1.1.1k
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
doc
/
perl-Sys-Virt
/
examples
/
View File Name :
events.pl
#!/usr/bin/perl use Sys::Virt; use Sys::Virt::Event; my $uri = shift @ARGV; Sys::Virt::Event::register_default(); my $quit = 0; my $c = Sys::Virt->new(uri => $uri, readonly => 1); sub lifecycle_event { my $conn = shift; my $dom = shift; my $event = shift; my $detail = shift; printf "%s %s %d %d\n", $conn->get_uri, $dom->get_name, $event, $detail; } sub agent_lifecycle_event { my $conn = shift; my $dom = shift; my $state = shift; my $reason = shift; printf "Agent %s %s state=%d reason=%d\n", $conn->get_uri, $dom->get_name, $state, $reason; } $c->domain_event_register_any(undef, Sys::Virt::Domain::EVENT_ID_LIFECYCLE, \&lifecycle_event); $c->domain_event_register_any(undef, Sys::Virt::Domain::EVENT_ID_AGENT_LIFECYCLE, \&agent_lifecycle_event); $c->register_close_callback( sub { my $con = shift ; my $reason = shift ; print "Closed reason=$reason\n"; $quit = 1; }); while (!$quit) { Sys::Virt::Event::run_default(); }