Re: Cacti script_server index invocation
Nitzan Zaifman <[email protected]> Thu, 18 Jun 2015 19:19:03 +0000
| Newsgroups | gmane.network.cacti.user |
|---|---|
| Message-ID | <[email protected]> |
Thank you very much again... I placed it here so you understand exactly why I asked this, but you got it straight away anyhow. Best regards. -----Original Message----- From: Gandalf [mailto:[email protected]] Sent: Thursday, June 18, 2015 9:57 PM To: Support requests/questions about cacti Subject: Re: [cacti-user] Cacti script_server index invocation Am 18.06.2015 um 20:37 schrieb Nitzan Zaifman: > Thanks you very much, > > Quote: > ' > "Index Count Changed" == Cacti _always_ gets the number of indexes ' > > Does this mean that cacti_always_gets the index count and if I happen to choose: "index count changed" then a full re-index will occur if that number is changed? No, Cacti gets the index count only, when "Index Count Changed" has been chosen (or on a full reindex; e.g. when you manually perform a reindex operation). > Or it means that ONLY had I choose this "index count changed" method, then *and only then* will cacti_always_gets this num_indexes? If I choose something else, then cacti won't get num_indexes nor the whole indexes. Yes, that's it > In <some of my> scripts the cost of "index" and "num_index" is the same and very high compared to specific data asked. I want to avoid num_indexes and index queries as much as possible. Yes, that may happen. In this case, only you may decide if a faster way of "counting" exists. If it does not exist, it is _not_ recommended to select that reiondex option without need. But if "Uptime goes backwards" is the wrong solution, you may instead want to schedule a e.g. daily reindex on those data queries. > Can data queries (<input>) generate index queries? > > I use script server scripts as a mean to "cache" results of other scripts, with the add benefit of allowing GUI access to choose interested stats with "queries", the data itself (results of other scripts) is saved in static array variables thus filled only once and read for whatever's needed. > Some of those underlying scripts can be very expensive. > BTW, IMHO this technique is very elegant and affective for those kind of things and should go to some FAQ or a new manual in the future, but NM that now. Please add such a topic to the forums or to the documentation, if need be. I already did a very similar approach in the past but it seemed to me to be very specific. Perhaps you have found a better approach. > BTW2, I use the same technique on full PHP script_server scripts (i.e. not running underlying scripts), and there I can granularly add stuff to my static data structures on first access - if it interests anyone on the list I'll provide an example. > > Sorry for the lengthy mail and hope that that clarifies what I'm after. > If you need an example, this is part of a script server that runs expansive underlying scripts (the relevant cmd part): > switch ($cmd) { This better fits into the forums. There's not that much traffic on the mailing list Reinhard ------------------------------------------------------------------------------ _______________________________________________ cacti-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/cacti-user ------------------------------------------------------------------------------