Creating multiple cacti graphs using the same script is really easy. It took me a minute to realize it but if your script input values then you can just click the “Create Graph” drop down and create multiple of any graph you have configured. See the two images below that show how to do this visually.
Modify Graph Templates In Cacti Admin:
Click Create Button In Cacti Admin To Generate New Graph:
Create as many graphs as you like. This is really useful for grabbing historical postgresql table data. I created some templates to have cacti graph postgresql table data including total size, data only, and indexes only.