Skip to content

Instantly share code, notes, and snippets.

@Aricg
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save Aricg/3a1d82e32cabad57dbb7 to your computer and use it in GitHub Desktop.

Select an option

Save Aricg/3a1d82e32cabad57dbb7 to your computer and use it in GitHub Desktop.
Add machine to cacti
#!/bin/bash
usage () {
cat << EOF
Description: pass the variables for description ip password privpass to add a host to cacti
Example:
./$0 jenkins020 jenkins020.foo.org secret privpass
EOF
exit 1
}
if [[ -z "$@" ]]; then usage
fi
sudo php /var/lib/cacti/cli/add_device.php \
--description="$1" \
--ip="$2" \
--template=9 \
--version=3 \
--username="cacti" \
--password="$3" \
--privpass="$4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment