String Group?

Hi All,

I couldnt find any examples or doco on this.

I have disks in a NAS, which have a SNMP state, GOOD, BAD, FAILED. I’ve managed to record these into items. I want to create a group, and have the state of the group either be one of the three states or anyone 1 of the 8 disks in the group. I didnt have any success. The state is defined as UNDEF, despite the individual string item showing correct.

Is a Group:String value and how would I define it to one of the 3 states?


Map them to a number, 1-3 and min / max that in a group. Map the number back to a text state.

Group:String is certainly a valid type. The trouble is I do not think there is any useful way to calculate its state. You cannot postUpdate Group states from rules, and I doubt any of the available aggregation functions work on String members.
You could try
Group:String:AND("GOOD". "Notgood") etc.
which might give a group that is “GOOD” when all members are good - but I doubt it.

Interesting Crispin! nice approach.




/*SNNP Devices */
Group gSNMP
Group:Number:MAX gDisksState    "[MAP(]"

String QNAP_UpTime "QNAP UpTime" (gSNMP)                      { snmp="<[]" }
String QNAP_CPUTemp    (gSNMP)                                { snmp="<[]" }
String QNAP_SystemTemp (gSNMP)                                { snmp="<[]" }
Number QNAP_CPULoad    (gNSMP,gInfluxDB)                      { snmp="<[]" }

String QNAP_Disk1State    "[MAP(]" (gSNMP,gDisksState)                              { snmp="<[]" }
String QNAP_Disk2State    "[MAP(]" (gSNMP,gDisksState)                              { snmp="<[]" }
String QNAP_Disk3State    "[MAP(]" (gSNMP,gDisksState)                              { snmp="<[]" }
String QNAP_Disk4State    "[MAP(]" (gSNMP,gDisksState)                              { snmp="<[]" }
String QNAP_Disk5State    "[MAP(]" (gSNMP,gDisksState)                              { snmp="<[]" }
String QNAP_Disk6State    "[MAP(]" (gSNMP,gDisksState)                              { snmp="<[]" }
String QNAP_Disk7State    "[MAP(]" (gSNMP,gDisksState)                              { snmp="<[]" }
String QNAP_Disk8State    "[MAP(]" (gSNMP,gDisksState)                              { snmp="<[]" }

Ill see if this indeed works!

Unless I’m doing something wrong, REST still shows the individual disk item status, as GOOD, rather than 1.

Well, yes. MAP in Item labels only affect the displayed state of an Item.

Some bindings will allow you to do a transform on the incoming data, I don’t know about snmp.

MAX makes no sense for strings, and I’m sure will result in UNDEF

I removed the MAX strings, legacy stuff not used/doesnt work.

Hmmm… So I guess Crispin’s idea won’t work.

Bugger. Of course :frowning:

Transform then not work?
A simple rule would do the job too just not implicit.

Another option is map - undef=Something Bad!

If they’re all good then it’ll be good. Else bad :slight_smile: