APCUPSD-Auswertescript

Ich gehe auch nach einem Blick auf php.net davon aus, isset prüft die Existenz einer Variable. Die Code-Zeile oben setzt also „$bv“ auf den Wert von „$nut[‚battery.voltage‘]“ falls letzteres überhaupt vorhanden ist.

Full ACK. :slight_smile:

Den Rest kenn ich nicht.

Die Codezeile ist aus dem NUT Script, welches die Daten von einem NUT-Daemon haben will. Das hat nichts mit NAS zu tun. Wenn Du ein Synology NAS hast, das verwendet NUT, andere jedoch APCUPSD. Das NUT Script kann man nicht auf die Ausgaben von APCUPSD anwenden und umgekehrt.

Wenn man in den Scripten eine bisher nicht aufgeführte Metrik in einer IPSVariable anzeigen will muss man nur

  1. in $vartypes das Array mit der IPS Variablendefinition ergänzen
  2. aus dem $apc(bzw $nut) Array den Wert für das entsprechende Keywort extrahieren
  3. den mit Wert storevars(…) der IPS-Variable zuweisen

Dann am einfachsten den Baum für die UPS löschen und neu anlegen lassen, damit die Variablen angelegt werden. Allerdings bekommen dann auch alle schon bekannten Variablen neue IDs

Tommi

Das war des Rätsels Lösung! Ein „print_r ($nut)“ zeigt die Liste der Möglichkeiten. Klasse!

Dank und Grüße
galleto

Das equivalent zu apcaccess zum Auflisten der möglichen Werte ist upsc. Auf der Syno kann z.B.

>upsc ups@localhost
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.date: 2001/09/25
battery.mfr.date: 2009/07/04
battery.runtime: 1395
battery.runtime.low: 120
battery.temperature: 29.2
battery.type: PbAc
battery.voltage: 27.3
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Back-UPS BR  800
....

Der Name ups@<host> ist nicht konstant sondern ist der Wert in […] in ups.conf
Tommi

Jepp, klappt hier auch.

Dank und Grüße
galleto

Hi,

The script is working fine, I see the UPS values. I only get some errors when the script is running.


Warning:  IPS_SetProperty: Instance #0 not found! in I:\IP-Symcon\scripts\__compatibility.inc.php on line 182
Warning:  IPS_ApplyChanges: Instance #0 not found! in I:\IP-Symcon\scripts\30184.ips.php on line 78
Warning:  RegVar_SendText: Instance #37621 does not implement this function! in I:\IP-Symcon\scripts\30184.ips.php on line 80
Warning:  IPS_SetProperty: Instance #0 not found! in I:\IP-Symcon\scripts\__compatibility.inc.php on line 182
Warning:  IPS_ApplyChanges: Instance #0 not found! in I:\IP-Symcon\scripts\30184.ips.php on line 85
Warning:  RegVar_GetBuffer: Instance #37621 does not implement this function! in I:\IP-Symcon\scripts\30184.ips.php on line 87
Warning:  RegVar_SetBuffer: Instance #37621 does not implement this function! in I:\IP-Symcon\scripts\30184.ips.php on line 89 

I hope someone can help me with this.

Thanks ….

Albert

which instance type is your instance with id 37621? should be a registervariable instance.
see into the script line 9, looks similar $regvars=array(39886);
you need to put your own registervariable instanceID(s) into. This registervariable instance should get your socket instance to the apcupsd host as parent(„Übergeordnete Instanz“) and this script as target script („Ziel Script“).

Thomas

Hi Thomas,

Thanks, I found the problem. Very simple, and a little mistake from my side.

In your example there are two ID’s in the regvar on line 9. I supposed that these are the regvar and Client Socket, but it are your two regvar’s. I totally overlooked that one :slight_smile:

I changed it and all works fine now.

Thanks for the very nice script, my UPS is online now.

Albert

Hi

Ich habe das Skript für neuere Versionen von IP-Symcon angepasst;

Das Skript wird ausgeführt und dann passiert nix mehr… konstant „Ausführung“.

Kann das vielleicht mal jemand gegentesten ? Bin dankbar für Hinweise.

Gruss
Michael



<?php
/**
RegVar-Script für APCUPSD status text
[www.tdressler.net- IPSymcon Erweiterungen](www.tdressler.net/ipsymcon)
V0.9 13.11.2011
*/
 #######Begin Config
 //IPS Variablen IDs
 $regvars=array(22552 /*[APC Client Socket\Register Variable]*/);
 $GLOBALS['parent']=0; //parent ID of master category
 $GLOBALS['catname']='APCUPSD'; //master category name
 $GLOBALS['idname']='SERIALNO'; //unique ID parameter

 $logfile='apc.log';
 ######End Config
/*
hardcoded NOMPOWER values related to Modelname digit value
							 !!!
first line Smart-UPS 700 ->480W
*/
 $nomvals=array(
   700=>480,
 	750=>500, //smart ups xxx
	1000=>670,
 	1500=>980,
 	2200=>1580,
 	3000=>2700,
 	420=>260, //Smart ups SC xxx
 	450=>280,
 	620=>390,
 	350=>210, //Back UPS CS/ES
 	400=>240,
 	500=>300,
 	550=>330,
	800=>540); //Back UPS RS

$GLOBALS['nomvals']=$nomvals;
$vartypes=array(
	'ID'=>array('type'=>3,'profile'=>''),
	'VoltIn'=>array('type'=>1,'profile'=>'~Volt.230'),
	'FreqIn'=>array('type'=>2,'profile'=>'Freq.netz'),
	'VoltOut'=>array('type'=>1,'profile'=>'~Volt.230'),
	'LoadPct'=>array('type'=>1,'profile'=>'~Battery.100'),
	'Charged'=>array('type'=>1,'profile'=>'~Battery.100'),
	'Watt'=>array('type'=>1,'profile'=>'~Watt.3680'),
	'NomPower'=>array('type'=>1,'profile'=>'~Watt.3680'),
	'TimeLeft'=>array('type'=>2,'profile'=>'Time.min'),
	'LastOn'=>array('type'=>3,'profile'=>'~String'),
	'Model'=>array('type'=>3,'profile'=>'~String'),
	'Name'=>array('type'=>3,'profile'=>'~String'),
	'Status'=>array('type'=>3,'profile'=>'~String'),
   'Temperatur'=>array('type'=>2,'profile'=>'~Temperature'),
   'OnLine'=>array('type'=>0,'profile'=>'~Alert.Reversed')
);
$GLOBALS['vartypes']=$vartypes;
$GLOBALS['varids']=null;

 //NonStandard Profiles (needed for Webfront)
check_profile('Time.min',2,null,' min',null,null,null,1);
check_profile('Freq.netz',2,null,' Hz',45,55,1,1);
			//Standard-Regvar Handling
 if ( $_IPS['SENDER'] == "RegisterVariable")
{
	$reg=$_IPS['INSTANCE'];
   // bereits im Puffer der Instanz vorhandene Daten in $data kopieren
  	$data  = RegVar_GetBuffer($reg);
  	// neu empfangene Daten an $data anhängen
  	$data .= $_IPS['VALUE'];
  	RegVar_SetBuffer($reg, $data);
}else{
	foreach($regvars as $reg)
	{
		$in=null;
		 $id=IPS_GetParent($reg);
	//Nicht registervariable, also manuell
	//socket öffnen
		//CSCK_SetOpen($id,true);
		IPS_SetProperty($id,"Open",true);
		IPS_ApplyChanges($id);
	//befehl senden
		RegVar_SendText($reg,chr(0).chr(6)."status");
	//warten
		sleep (1);
	//Socket schliessen
		//CSCK_SetOpen($id,false);
		IPS_SetProperty($id,"Open",false);
		IPS_ApplyChanges($id);
	//Rückgabe abholen
		$in  = RegVar_GetBuffer($reg);
	//RegVar bereinigen
		RegVar_SetBuffer($reg, "");
	//Ausgabe in Array wandeln
	   $apc=format_data($in);
	//loggen
		logge($logfile,$apc);
	//parsen
	   if (isset($apc['APC']) && preg_match("/^(\d+),(\d+),(\d+)/",$apc['APC'])) {
			parse_apc($apc);
		}else {
		   $msg='no valid data';
			if (isset($apc['APC'])) ':'.$msg.$apc['APC'];
			ips_logmessage('APC',$msg);
		}
	}
}
/**
* parses APCUPSD status parameter
* @param array APC parameter
*/
function parse_apc($apc) {

	$catname=$GLOBALS['catname'];
	$nomvals=$GLOBALS['nomvals'];
	$idname=$GLOBALS['idname'];
	//extract data into array

	//Status auswerten
	$vartypes=$GLOBALS['vartypes'];
	$varids=null;
	//define null values as default
	$status=null;
	$model=null;
	$name=null;
	$lv=null;
	$lf=null;
	$ov=null;
	$lpct=null;
	$temp=null;
	$np=null;
	$dev=null;
	$load=null;
	$online=null;
	$lo=null;
	$ch=null;
	//try to update values with real parameter from APC
	if (isset($apc[$idname])){
		$dev=$apc[$idname];
	}else{
	   IPS_LOGMessage('APC',"Identifier $idname not found");
	   return;
	}
	if (isset($apc['LINEV'])) { list($lv,$rest)=explode(' ',$apc['LINEV'],2);}
	if (isset($apc['LINEFREQ'])) {list($lf,$rest)=explode(' ',$apc['LINEFREQ'],2);}
	if (isset($apc['OUTPUTV'])){ list($ov,$rest)=explode(' ',$apc['OUTPUTV'],2);}
	if (isset($apc['LOADPCT'])){list($lpct,$rest)=explode(' ',$apc['LOADPCT'],2);}
	if (isset($apc['ITEMP'])){list($temp,$rest)=explode(' ',$apc['ITEMP'],2);}
   if (isset($apc['MODEL'])) {$model=$apc['MODEL'];}
   if (isset($apc['STATUS'])) {$status=$apc['STATUS'];}
   if (isset($apc['UPSNAME'])) {$name=$apc['UPSNAME'];}
   if (isset($apc['TIMELEFT'])){ list($tl,$rest)=explode(' ',$apc['TIMELEFT'],2);}
   if (isset($apc['BCHARGE'])){ list($ch,$rest)=explode(' ',$apc['BCHARGE'],2);}
	//retrieve nominal power from APC
	if (isset($apc['NOMPOWER'])) {
			   //value is supplied by APC
				list($np,$rest)=explode(' ',$apc['NOMPOWER'],2);
	}else{
			   //try to use hardcoded power table based on digits in model name(ex. SMART UPS 750)
			   if (!is_null($model)) {
					preg_match("/(\d{3,4})/",$model,$result);
					if (isset($result[0]) && (isset($nomvals[$result[0]]))){
						$np=$nomvals[$result[0]];
						//IPS_Logmessage('APC',"$model: NOMPOWER from Model=$np");
					}
	 			}
	}

	//format last on battery value, if any
	if (isset($apc['XONBATT'])) {
				list($date,$time, $rest)=explode(' ',$apc['XONBATT'],4);
				$lo="$date $time";
	}
	$online=($status=='ONLINE');
	$sensorname=$model;
	if ((is_null($model)) || (is_null($dev))) {
			   IPS_Logmessage('APC',"Missing Modelname ($model) od DeviceID($dev)");
	}else{
	      $GLOBALS['varids']=null;
         IPS_Logmessage('APC',"Dev:$dev Name: $sensorname");
			get_ips_vars($dev,$vartypes,$catname,$sensorname);
			$varids=$GLOBALS['varids'];
			if (is_null($varids)) {
			   //Error, no vars created
	   		IPS_LogMessage($catname,'No VarIDs!');
			}else{
				//give $np a pseudo value to fill variable, if not found until now
			   if (is_null($np)){ $np=500;}
            //NominalPower defined in IPS has priority over Device Value
				$np=(isset($varids['NomPower']['val']) &&($varids['NomPower']['val']>0))?$varids['NomPower']['val']:$np;
				//calculate current power based on nominal power and load percent values if available
				if ((! is_null($np)) && (! is_null($lpct))) {
					$load=$np*$lpct/100;
				}
			//store
				storevars($varids,'OnLine',$online);
				storevars($varids,'Status',$status);
				storevars($varids,'Model',$model);
				storevars($varids,'Name',$name);
				storevars($varids,'NomPower',$np);
				storevars($varids,'LastOn',$lo);
				storevars($varids,'VoltIn',$lv);
				storevars($varids,'FreqIn',$lf);
				storevars($varids,'VoltOut',$ov);
				storevars($varids,'LoadPct',$lpct);
				storevars($varids,'Watt',$load);
				storevars($varids,'TimeLeft',$tl);
				storevars($varids,'Charged',$ch);
				storevars($varids,'Temperatur',$temp);
			}
	}
}
/**
* Check if is Varaible available and store value
* deletes variable if value is null, meens parameter not supplied by apc
* recreate variable if value is set, but no variable ID, means value supplied now
* @param array current variable ids in tree
* @param string name of variable
* @param variant value to store
*/
function storevars($ids,$name,$val) {
	$vartypes=$GLOBALS['vartypes'];
	$parent=$ids['%parent%']['id'];
	$vid=isset($ids[$name]['id'])?$ids[$name]['id']:null;
	$typ=$vartypes[$name]['type'];
	//IPS_Logmessage('APC',"$vid:$name=$val"); //debug
	if (is_null($val)) {
	   if (isset($vid)) {
	      if (IPS_VariableExists($vid)) IPS_DeleteVariable($vid);
		}
	}else{
	   //check value variable id
		if (is_null($vid)) {
		   //not there, recreate
		   $vid=createvarfromtypes($name,$parent);
		   $pname=IPS_GetName($parent);
		   IPS_Logmessage('APC',"$pname: Variable $name not found, recreated as ID $vid");
		}
		//recheck
		if (isset($vid)) {
		switch ($typ) {
		      case 2: $val=floatval($val);break;
		      case 1:  $val=intval($val); break;
		   }
			if (IPS_VariableExists($vid)) SetValue($vid,$val);
		}
	}
}
/**
* creates variables with help of typinfo array by name
* @param string name of variable
* @param integer parent ID of parent object
*/
function createvarfromtypes($name,$parent) {
	$vartypes=$GLOBALS['vartypes'];
	$typ=isset($vartypes[$name]['type'])?$vartypes[$name]['type']:null;
   $vid=null;
   if (($name>'')&&($parent>-1) && (!is_null($typ))) {
		$vid=IPS_CreateVariable($typ);
		ips_setname($vid,$name);
		ips_setParent($vid,$parent);
		if (isset($vartypes[$name]['profile'])) {
      	$profile=$vartypes[$name]['profile'];
			IPS_SetVariableCustomProfile($vid,$profile);
		}
		$GLOBALS['varids'][$name]['id']=$vid;
		$GLOBALS['varids'][$name]['val']=0;
      ips_logmessage('APC',"Created Var $name: Parent:$parent, Type:$typ, ID:$vid");
   }else{
      ips_logmessage('APC',"Missing Values for create Var $name: Parent:$parent, Type:$typ");
	}
	return $vid;
}
/**
* IPS Variablen handler
* creates variables as needed
* returns assoc. Array with IPS Variable ID and Value
* @param integer Sensor Address
* @param array Array with Variable Names, Types and Profiles
* @param string Sensor Group Master Categorie Name
* @param string Sensor default name, will be extended with $addr
*/
function get_ips_vars($addr,$vartypes,$cat,$sens) {
 	$varids=null;
 	$parent=(isset($GLOBALS['parent']) && IPS_ObjectExists($GLOBALS['parent']))?$GLOBALS['parent']:0;
	//master category
	 $master=@IPS_GetObjectIDByName($cat,$parent);
	//no master cat, create new
	 if (!$master) {
   	$master=IPS_CreateCategory();
   	IPS_SetName($master,$cat);
   	IPS_SetParent($master,$parent);
		if ($master>0) {
	   	IPS_LogMessage('APC', "Master category created, ID=$master
");
   	}else{
			IPS_LogMessage('APC', "Can't create Master Category
");
			return null;
		}
 	}
	//check childrens for varable with name "ID"
  $id=0;
  if ($master>0) {
  //get chilren sensors
   $Sensors=IPS_GetChildrenIDs($master);
   foreach($Sensors as $sid) {
   	$name=IPS_GetName($sid);
      //print "$sid:".$name."
"; //debug
		//get vars for each sensor
		$vars=IPS_GetChildrenIDs($sid);
      foreach($vars as $vid) {
       $obj=IPS_GetObject($vid);
         $vname=$obj['ObjectName'];
         $typ=$obj['ObjectType'];
          //Variable
          if ($typ==2) { //Variable
         	//if ID, here is the address
         	if ($vname=="ID") {
         		$i=GetValue($vid);
         		//go out if matches, $id returns the sensor categorie id
         		if ($i===$addr) {
         	   	$id=$sid;
         	   	break;
         		}
         	}
         }
      }
      if ($id>0) break;
   }
   //if variable ID doesnt exists assume we have to create all
	if ($id==0) {
		//Sensor with address $addr not found in IPS, create new sensor
	   $id=ips_createCategory();
	   ips_setName($id,$sens);
	   ips_setParent($id,$master);
		//creates all needed variables for the new sensor
		foreach (array_keys($vartypes) as $name) {
		   $vid=createvarfromtypes($name,$id);
         //preload variables
			SetValue($vid,0);
    		$varids[$name]['id']=$vid;
      	$varids[$name]['val']=0;
			//Store address in $ID for next time
         if ($name=='ID') {
	         SetValue($vid,$addr);
   	      $varids[$name]['val']=$addr;
			}
		}
	}else{
	   //found matching cat, collect ids and vals for this sensor
	   $vars=IPS_GetChildrenIDs($id);
      foreach($vars as $vid) {
         $obj=IPS_GetObject($vid);
         $name=$obj['ObjectName'];
         $typ=$obj['ObjectType'];
         if ($typ==2) { //Variable
         	$val=GetValue($vid);
         	$varids[$name]['id']=$vid;
         	$varids[$name]['val']=$val;
         }
      }
	}
	//store parent
	$varids['%parent%']['id']=$id;
	$GLOBALS['varids']=$varids;
	//returns IDs and Values of this Sensor, Name is Key
	return $varids;
 }
}
/**
*
* @param string $text output from apcupsd
* @return array $apc Array Key/Values
*/
function format_data($text){
   	$entry=explode("
",$text); //Satztrenner
		$apc=array();
		foreach($entry as $line) {
		   if (! $line || strlen($line)<2) continue;
			$p1=ord($line[0]); //immer 00
			$p2=ord($line[1]); //Kennziffer
			if ($p2>0) {
					$content=substr($line,2);
					//Key /Value Paare durch ':' getrennt
					if (strpos($content,":")>0) {
						list($key,$value)=explode(":",$content,2);
						$apc[trim($key)]=trim($value);
					}
			}
		}
		return $apc;
}
//#############################
/**
* do simple logging
* @param string $logfile Filename for logfile
* @param string $text
* @returns void
*/

function logge($logfile,$apc) {
	if (strlen($logfile)>0) {
		$log=fopen($logfile,"a+");
		if ($log) {
	   	$d=date("r");
	   	fwrite($log,"#----$d
");
	      foreach ($apc as $key=>$value) {
         	fwrite($log, "$key:$value
");
         }
 			fflush($log);
			fclose($log);
		}
	}
}
/**
* Get ID by name if exists, else create
* @Param String Name
* @param integer Parent-ID
* @param integer Variable Typ (0..3)
* @return integer ID
*/
function getVid($name,$par,$typ) {
	$vid = @IPS_GetVariableIDByName($name, $par);
	if ($vid === false) {
		$vid=IPS_CreateVariable($typ);
		ips_setname($vid,$name);
		ips_setParent($vid,$par);
		setValue($vid,'');
	}
	return $vid;
}
/**
* Check profile by name if exists, else create
* @Param String Name
* @param integer Variable Typ (0..3)
* @param String prefix befor value
* @param String suffix after value
* @param integer min value
* @param integer max value
* @param integer step value
* @param integer digits for formatting
*/

function check_profile($pname,$typ,$prefix,$suffix,$min,$max,$step,$digit=0) {
if (!IPS_VariableProfileExists($pname)) {
	if (IPS_CreateVariableProfile($pname,$typ)) {
	   IPS_SetVariableProfileText($pname,$prefix,$suffix);
		if (isset($min) && isset($max) && isset($step)) {
	   	IPS_SetVariableProfileValues($pname,$min,$max,$step);
	   }
	  	if (isset($digit)) {
	   	IPS_SetVariableProfileDigits($pname,$digit);
	   }
 	}
}
}
?>

Hmm … warum musste da etwas aktualisiert werden? Bei mir läuft das Script immer noch einwandfrei !?

@Tetrapack

Anpassung an Linux / Raspberry: Dinge wie $IPS_SENDER wird zu $_IPS[‚SENDER‘]

Ich muss was übersehen haben: Das Skript beendet nicht und es werden keine Variabeln erstellt…

Michael

Ich hatte letzten Herbst mal alle meine Scripte auf veraltete Befehle geprüft und umgeschrieben.
Kann meine Version gerne heute abend mal Posten.
Michael

@Nall Chan: Würde mich sehr über den Post des Skripts freuen.

Danke im voraus
Michael

Die Scripte sind zu 99% Identisch :slight_smile:
Du hast alles richtig gemacht.
Es ist ein BUG in der Testversion.
Der ClientSocket wird nicht mehr geschlossen. :frowning:

Unter Windows geht dein Script :smiley:
Ich habe mal die PHP-Tages in einem Post eingefügt. Erhöht die Lesbarkeit :wink:

Michael

Hi,

Since update to IPS 4 I get an error in the script on line 457.

Warning: date() expects parameter 2 to be long, string given

Line 457: $LastTime = date(„d-m-Y H:i“,"$EreignisInfo[LastExecute]");

Someone maybe know how to solve this, I couldn’t find any other article about this on the forum.

Thanks

Albert

Hi!

Take a look at this page:
IPS_GetScript — IP-Symcon :: Automatisierungssoftware

You have to change „LastExecute“ in „ScriptExecuted“.

Since IPS 4 some things are changed :wink:

Greets,
Chris

Thank you, it’s working again …

Hey,
Ich habe gerade auch ein Problem:

Ich habe eine USV mittels APC-UPSD an meinem Server - funktioniert ganz herrlich mit IPS.
Jetzt das Problem:

Eine zweite hängt an meiner (Sophos UTM) Firewall.
Da läuft NUT drauf - ich habe alles nach der Anleitung eingerichtet, leider bekomme ich keine Verbindung, sondern das:


Warning:  Instanz #10157 existiert nicht in C:\IP-Symcon\scripts\__compatibility.inc.php on line 280

Warning:  Instanz #10157 existiert nicht in C:\IP-Symcon\scripts\22127.ips.php on line 81

Warning:  Socket ist nicht verbunden in C:\IP-Symcon\scripts\22127.ips.php on line 85

Warning:  Instanz #10157 existiert nicht in C:\IP-Symcon\scripts\__compatibility.inc.php on line 280

Warning:  Instanz #10157 existiert nicht in C:\IP-Symcon\scripts\22127.ips.php on line 122

(Antwort des Skripts)
Port & IP sind korrekt! (In der Clientsocket-Instanz)

NUT verlangt ja eine Authentifizierung mittels einem Eintrags in der upsmon.conf.
Bsp. „MONITOR ups@localhost 1 upsmon upsmon master“
Kann es daran liegen?

Andernfalls wird die Verbindung verweigert - das denke ich ist mein Problem, ich sehe keine Chance das im Skript irgendwie mitzugeben bzw. habe zu wenig Ahnung davon um das hinzuzufügen.

Zudem (ggf sehe ich das auch völlig falsch), ist in dem NUT Skript irgendwo

RegVar_SendText($reg,"LIST UPS
");

.
Wenn ich das ganze richtig verstehe, wird die UPS in NUT aber mit „upsc ups“ (wobei hier ups der Name der USV ist) abgefragt. Da kommt nämlich dann das bei raus:

m-net_firewall:/root # upsc ups
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.mfr.date: 2001/12/01
battery.runtime: 2580
battery.type: PbAc
battery.voltage: 13.5
battery.voltage.nominal: 12.0
device.mfr: American Power Conversion
device.model: Back-UPS 500
device.serial: AB0148324348
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ups/ups0
driver.version: 2.6.2
driver.version.data: APC HID 0.95
driver.version.internal: 0.35
ups.firmware:  6.3.I
ups.firmware.aux:  c1
ups.mfr: American Power Conversion
ups.mfr.date: 2001/12/01
ups.model: Back-UPS 500
ups.productid: 0002
ups.serial: AB0148324348
ups.status: OL
ups.timer.reboot: 0
ups.vendorid: 051d

Ob da noch mehr zu holen ist, weiß ich natürlich nicht…
Vielleicht ist mein Ansatz auch völlig daneben, ich bin auf jeden Fall für jede Hilfe dankbar!
Gruß,
Matthias

Hi!

Das hier:

Instanz #10157 existiert nicht

…klingt eher nach einem Fehler in deiner Konfig/Einrichtung.

Check nochmal deine Skripte, RegVar, …

Grüße,
Chris

Die Idee hatte ich auch schon, allerdings taucht die #10157 nirgends als Variable auf.
Habe das Skript schon durchsucht, zudem habe ich diese auch nicht in IPS.

Skript ist von hier: http://www.tdressler.net/ipsymcon/nut_ips.html

Da war ja für mich nur das einzutragen:

 $regvars=array(38726);
 $GLOBALS['parent']=19379; /*[Komponenten\APC-USV]*/; //parent ID of master category
 $GLOBALS['catname']='APC-USV'; //master category name

Das ist alles soweit korrekt, die Regvar ist angelegt, der Client-Socket auch, Port ist richtig, IP ebenfalls.

Gru,
Matthias