lopes / netbox-scanner

A scanner util for NetBox
MIT License
165 stars 40 forks source link

different configs for cron run #16

Closed ohobby closed 4 years ago

ohobby commented 4 years ago

Is it possible to use different configs at different sheduled cron tasks? Some Networks must scanned often and some less often.

ToroNZ commented 4 years ago

Try running it from a cronjob by using a container ? Perhaps a loop for each config file and mount a different one each time.

#!/bin/bash
FILES=/path/to/configs/*
for f in $FILES
do
  echo "Processing $f config file..."
  docker run --rm -ti --user 1000320000 --cap-drop=all -v $f:/home/netbox/.netbox-scanner.conf toronz/netbox-scanner-docker:latest
done

Source here: https://github.com/ToroNZ/netbox-scanner-container