13 lines
453 B
Perl
13 lines
453 B
Perl
|
sub upid_encode {
|
||
|
my $d = shift;
|
||
|
|
||
|
# Note: pstart can be > 32bit if uptime > 497 days, so this can result in
|
||
|
# more that 8 characters for pstart
|
||
|
return sprintf("UPID:%s:%08X:%08X:%08X:%s:%s:%s:", $d->{node}, $d->{pid},
|
||
|
$d->{pstart}, $d->{starttime}, $d->{type}, $d->{id},
|
||
|
$d->{user});
|
||
|
}
|
||
|
|
||
|
print upid_encode({
|
||
|
node => 'pve', pid => 3333, pstart => 34234,
|
||
|
starttime => 34234324, type => 'unknow', id => '', user => 'root@pve' });
|