How can I list the graphs for a host, or at the very least the number of graphs?
I'm thinking of a condition where I'd add more graphs depending on such output but all I see is to list available queries and such, I need the actual number/names of the graphs you see when you go to edit a host and click "*Graph List"
You don't actually say programmatically, but you have tagged this 'perl'... The graph_local table in the Cacti SQL database has a list of all graphs and which host they are related to.
Will give you a list broken down by host_id. Pull in the host description from the host table if you need it:
However you should also look at the Autom8 plugin, if what you are trying to achieve is something like: "Find all 'up' ethernet interfaces, and create a traffic graph for one's that don't already have one", or "Find all devices with Host Template XX, and add a graph for CPU usage if they don't have one". Autom8 will do this for you.