This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// php makephar.php create - create phar from last git commit | |
// php makephar.php deploy [suffix number] - Unpack the phar file with the maximum / specific suffix number | |
$exclude = ['/^resource/', '/^Wise/']; | |
$chmod = 644; | |
if (! isset($argv[1])) { | |
exit; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import sys | |
obj = json.loads(sys.stdin.read()) | |
for row in obj["result"]: | |
ip = [] | |
for ifs in row["interfaces"]: | |
ip.append("[id:{0},ip:{1}]".format(ifs["interfaceid"], ifs["ip"])) | |
print ("hostid : {0}, host : {1}, interfaces : {2}".format(row["hostid"], row["host"], ', '.join([str(x) for x in ip]))) |