Skip to content

Instantly share code, notes, and snippets.

@kkroesch
Last active February 7, 2022 20:58
Show Gist options
  • Select an option

  • Save kkroesch/cf5f160fe5104f67bba864a013996b34 to your computer and use it in GitHub Desktop.

Select an option

Save kkroesch/cf5f160fe5104f67bba864a013996b34 to your computer and use it in GitHub Desktop.
Make Nagios host definition from Nmap scan.
#!/usr/bin/awk -f
/Host:/ { print "define host {";
print "\tuse\tgeneric_host";
gsub(/[\(\)]/, ""); print "\thost_name\t", $3;
print "\taddress\t\t", $2;
print "}"; }
@kkroesch
Copy link
Copy Markdown
Author

Call with nmap -sn -T4 192.168.1.0/24 -oG - | ./lanparse.awk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment