Last active
February 7, 2022 20:58
-
-
Save kkroesch/cf5f160fe5104f67bba864a013996b34 to your computer and use it in GitHub Desktop.
Make Nagios host definition from Nmap scan.
This file contains hidden or 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
| #!/usr/bin/awk -f | |
| /Host:/ { print "define host {"; | |
| print "\tuse\tgeneric_host"; | |
| gsub(/[\(\)]/, ""); print "\thost_name\t", $3; | |
| print "\taddress\t\t", $2; | |
| print "}"; } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Call with
nmap -sn -T4 192.168.1.0/24 -oG - | ./lanparse.awk