mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-22 11:42:05 +00:00
Use version_cmp() to compare the version number
This commit is contained in:
parent
8bad779296
commit
4fed6d751a
@ -836,7 +836,7 @@ sub snmp_scan {
|
||||
# command.
|
||||
# for version 4.75, the line as :"Host 10.4.25.1 appears to be up ... good."
|
||||
# other higher version has line like this: "Discovered open port 161/udp on 10.4.25.1"
|
||||
if ($nmap_version <= 4.75) {
|
||||
if (xCAT::Utils->version_cmp($nmap_version,"4.75") <= 0) {
|
||||
$ccmd = "/usr/bin/nmap -P0 -v -sU -p 161 -oA snmp_scan @$ranges | grep up | grep good ";
|
||||
} else {
|
||||
$ccmd = "/usr/bin/nmap -P0 -v -sU -p 161 -oA snmp_scan @$ranges | grep 'open port 161' ";
|
||||
|
Loading…
x
Reference in New Issue
Block a user