]> git.proxmox.com Git - pve-cluster.git/blob - data/PVE/test1.pl
buildsys: add sbuild convenience target
[pve-cluster.git] / data / PVE / test1.pl
1 #!/usr/bin/perl -w -T
2
3 use strict;
4
5 use PVE::Cluster;
6 use PVE::INotify;
7 use PVE::AccessControl;
8 use Data::Dumper;
9
10
11 my $nodename = PVE::INotify::nodename();
12 PVE::Cluster::log_msg(1, "ident2", "msg1 öäü");
13 PVE::Cluster::log_msg(1, "root\@pam", "msg1 öäü");
14 #print PVE::Cluster::get_system_log(undef, 0);
15 exit 0;
16
17 #print PVE::Cluster::get_system_log(undef, 0);
18
19 #PVE::Cluster::cfs_update();
20
21 #my $res = PVE::Cluster::get_vmlist();
22 #print "TEST1: " . Dumper($res->{ids});
23
24 #exit 0;
25
26 while (1) {
27
28
29 print "update start\n";
30 PVE::Cluster::cfs_update();
31 print "update end\n";
32
33 my $res = PVE::Cluster::rrd_dump();
34 print "RRDDATA:" . Dumper($res);
35
36 #my $res = PVE::Cluster::cfs_file_version('user.cfg');
37 #print "VER $res\n";
38
39 sleep(1);
40 }
41 exit 0;
42
43 my $loopcount = 0;
44
45
46 while (1) {
47
48 PVE::Cluster::update();
49
50 PVE::Cluster::broadcast_vminfo({ count => $loopcount});
51
52 my $res = PVE::Cluster::get_vminfo($nodename);
53 print "TEST1: " . Dumper($res);
54
55 if (defined($res = PVE::Cluster::get_config("cluster.conf"))) {
56 print "TEST2: " . Dumper($res);
57 } else {
58 warn "get_config failed: $!\n";
59 }
60
61 $loopcount++;
62
63 sleep(2);
64 }
65