Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
emulab-devel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emmanuel Cecchet
emulab-devel
Commits
e03ff8bb
Commit
e03ff8bb
authored
22 years ago
by
Mac Newbold
Browse files
Options
Downloads
Patches
Plain Diff
Commit proper sorting I added weeks ago. (Stolen from snmpit_lib.pm)
parent
9c02b51b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sensors/slothd/sdisrunning.in
+25
-2
25 additions, 2 deletions
sensors/slothd/sdisrunning.in
with
25 additions
and
2 deletions
sensors/slothd/sdisrunning.in
+
25
−
2
View file @
e03ff8bb
...
@@ -52,9 +52,32 @@ order by pid,eid,node_id");
...
@@ -52,9 +52,32 @@ order by pid,eid,node_id");
}
}
}
}
sub
pcnum
{
substr
(
$a
,
2
)
<=>
substr
(
$b
,
2
)
}
# Stolen from snmpit_lib.pm:
#
# Used to sort a set of nodes in testbed order (ie. pc2 < pc10)
sub
tbsort
{
my
(
$a
,
$b
)
=
@_
;
$a
=~
/^([a-z]*)([0-9]*):?([0-9]*)/
;
my
$a_let
=
(
$
1
||
"");
my
$a_num
=
(
$
2
||
0
);
my
$a_num2
=
(
$
3
||
0
);
$b
=~
/^([a-z]*)([0-9]*):?([0-9]*)/
;
my
$b_let
=
(
$
1
||
"");
my
$b_num
=
(
$
2
||
0
);
my
$b_num2
=
(
$
3
||
0
);
if
(
$a_let
eq
$b_let
)
{
if
(
$a_num
==
$b_num
)
{
return
$a_num2
<=>
$b_num2
;
}
else
{
return
$a_num
<=>
$b_num
;
}
}
else
{
return
$a_let
cmp
$b_let
;
}
return
0
;
}
foreach
my
$n
(
sort
pcnum
@nodes
)
{
foreach
my
$n
(
sort
{
tbsort
(
$a
,
$b
)}
@nodes
)
{
print
"
checking slothd on
$n
:
";
print
"
checking slothd on
$n
:
";
#print "\n"; next;
#print "\n"; next;
print
check
(
$n
);
print
check
(
$n
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment