Sascha
21. März 2013 um 05:23
1
Hallo Gemeinde,
da dachte ich doch wirklich, daß ich meine Frage über die „Suche“ beantwortet bekomme…denkste
(oder ich blind)
Über IPS_GetVariableList() bekomme ich ja eine Liste aller angelegten Variablen…
Nun würde ich mir einfach gerne nur die ganzzahl der benutzen Variablen in eine integer variable schreiben.
Also quasi im webfront auf meiner sys info seite: Benutzte Variablen: 412
geht das ?
Lieben Dank und Gruß
Sascha
kronos
21. März 2013 um 08:12
2
Was für eine unchristliche Uhrzeit für solche Fragen…
echo count(IPS_GetVariableList());
Sascha
21. März 2013 um 14:08
3
ich hab ganz leise auf „senden“ geklickt…kohnte ja nicht wissen, daß ich dich damit wecke
Lieben Dank für die Antwort
Sascha
Hallo,
das hat mal ein User hier im Forum veröffentlicht.
Da bekommste noch mehr info.
Habe das bei mir installiert.
Gruß WiBo
<?php
// ---- Konfig: Variablen deklarieren ------------------------------------------
$datei = "d:\IP-Symcon\db\logging.db";
$ips_db_groesse_id = 44572 /*[System\IPS-Statistik\IPS-Statistik\IPS-DB Größe]*/ ;
$ips_db_zuwachs_id = 49496 /*[System\IPS-Statistik\IPS-Statistik\IPS-DB Zuwachs]*/ ;
$ips_objects_id = 31868 /*[System\IPS-Statistik\IPS-Statistik\IPS Objekts]*/ ;
$ips_profiles_id = 39816 /*[System\IPS-Statistik\IPS-Statistik\IPS Profiles]*/ ;
$ips_scripts_id = 25649 /*[System\IPS-Statistik\IPS-Statistik\IPS Scripts]*/ ;
$ips_variables_id = 21757 /*[System\IPS-Statistik\IPS-Statistik\IPS Variables]*/ ;
$ips_instances_id = 35050 /*[System\IPS-Statistik\IPS-Statistik\IPS Instances]*/ ;
$ips_categories_id = 18739 /*[System\IPS-Statistik\IPS-Statistik\IPS Categorys]*/ ;
$ips_links_id = 31005 /*[System\IPS-Statistik\IPS-Statistik\IPS Links]*/ ;
$ips_modules_id = 47082 /*[System\IPS-Statistik\IPS-Statistik\IPS Moduls]*/ ;
$ips_events_id = 33080 /*[System\IPS-Statistik\IPS-Statistik\IPS Events]*/ ;
// --- Konfig Ende -------------------------------------------------------------
// --- Script ------------------------------------------------------------------
// DB-Grösse herausfinden
$groesse = filesize("$datei");
$groesse = $groesse/1024/1024;
$groesse = round($groesse, 2);
// DB-Werte in Var schreiben
setValueFloat($ips_db_groesse_id, $groesse);
setValueFloat($ips_db_zuwachs_id, $groesse);
//echo "Die IPS-Datenbank ist $groesse MB gross.";
// Anzahl IPS Objekte ermitteln
$array = IPS_GetObjectList();
$count = count($array);
setValueInteger($ips_objects_id, $count);
//echo "Anzahl Objekte = $count - ";
$array =array();
// Anzahl IPS Profile ermitteln
$array = IPS_GetVariableProfileList();
$count = count($array);
setValueInteger($ips_profiles_id, $count);
//echo "Anzahl Profile = $count - ";
$array =array();
// Anzahl IPS Sripte ermitteln
$array = IPS_GetScriptList();
$count = count($array);
setValueInteger($ips_scripts_id, $count);
//echo "Anzahl Scripte = $count - ";
$array =array();
// Anzahl IPS Variablen ermitteln
$array = IPS_GetVariableList();
$count = count($array);
setValueInteger($ips_variables_id, $count);
//echo "Anzahl Variablen = $count - ";
$array =array();
// Anzahl IPS Instanzen ermitteln
$array = IPS_GetInstanceList();
$count = count($array);
setValueInteger($ips_instances_id, $count);
//echo "Anzahl Instanzen = $count - ";
$array =array();
// Anzahl IPS Kategorien ermitteln
$array = IPS_GetCategoryList();
$count = count($array);
setValueInteger($ips_categories_id, $count);
//echo "Anzahl Kategorieen = $count - ";
$array =array();
// Anzahl IPS Links ermitteln
$array = IPS_GetLinkList();
$count = count($array);
setValueInteger($ips_links_id, $count);
//echo "Anzahl Links = $count - ";
$array =array();
// Anzahl IPS Module ermitteln
$array = IPS_GetModuleList();
$count = count($array);
setValueInteger($ips_modules_id, $count);
//echo "Anzahl Module = $count - ";
$array =array();
// Anzahl IPS Events ermitteln
$array = IPS_GetEventList();
$count = count($array);
setValueInteger($ips_events_id, $count);
//echo "Anzahl Events = $count - ";
$array =array();
?>
Sascha
21. März 2013 um 15:01
5
Hallo WiBo,
das sieht in der Tat sehr interessant aus !
Das probier ich mal…sind die Variablen alles Integer ?
LG
Sascha
EDIT
Gerade gesehen…alle integer bis auf die DB größe…
bis auf die DB die sind Float, rest Integer
Sascha
21. März 2013 um 15:49
7
Hallo WiBo,
ich habs am Start…ist echt klasse !!!
Vielen Dank und liebe Grüße
Sascha
Dat is nit von mir.
Dat Lob gehört jemand anderem, weis nur nicht mehr wem?
Sascha
21. März 2013 um 18:55
9
das einzige, was mich wundert, ist daß die Datenbankgröße und der Zuwachs die gleiche Größe haben…zuerst dachte ich,das es bei dem ersten Start normal wäre…aber eben ist die datenbank dank geloggten variablen etwas größer geworden und ich habe immer noch gleiche werte.
Ich hätte fast erwartet, bei dem Zuwachs jetzt nur die „neue“ Datenmenge zu sehen…
Theorie: Datenbankgröße zeigt gesamtgröße an.
Zuwachs zeigt die Menge an, die seit Neustart dazugekommen ist…(den hab ich noch nicht gemacht)
Werd ich heute nacht mal testen…
Liebe Grüße
Sascha
Schau dir die IPS-Original-Charts der beiden Variablen an, vergleiche und staune
Sascha
22. März 2013 um 05:58
11
hmmmmm…wenn ich das script verstanden habe, wird genau das gleiche in die 2 Variablen geschrieben ?
Oder hab ich was übersehen ?
(sorry kronos, falls ich dich wieder geweckt habe ^^)
das ist richtig, nur die eine Variable ist ne Zählervariable, die andere ist Standard