smart мониторинг
-
-
Вроде разобрался
надо описывать так PhysicalDisk.SmartAttr(0,1) где 0 это номер диска, 1 это ID параметра смарт в данном случае Raw Read Error Rate.
но есть нюанс, результат выдается типом стринг в виде 6-ти двухбайтовых слов причем первое слово это наименее значащие цифры
То есть, результат например 24001С290000, то его надо перевернуть группируя по два символа. получается 0000291С0024, а потом переводить в десятичное число - получается 689700900 и это уже искомый рещультат. Можно ли сделать так чтобы он автоматически получал нужное число? -
Mozno napisat' transformation script, naprimer takoj:
sub convert_smart_value(value) { if (length(value) != 12) return 0; i = 11; rvalue = ""; while(i > 0) { rvalue = rvalue . substr(value, i, 2); i -= 2; } return int64("0x" . rvalue); } sub main() { return convert_smart_value($1); }Esli convertacija nuzna v neskol'kih DCI, to funkciju convert_smart_value mozno vinesti v script library.
Best regards,
Victor -
-
Da, tam tol'ko kosvennoe upominanie (str. 45):
It is possible to manually convert variable to a certain type, using a special function, named
depending on the variable type. For example, string(4). That way it is also possible to convert
NULL type variables. Therefore, to avoid runtime exceptions while processing NULL type variables,
it is advised to use manual conversion.Imelos' vvidu, chto est' funkcii s imenami, sootvetstvujuschimi tipam: int32, int64, string, etc. dlja javnoj konvertacii. Ja dobavlju ih opisanija v javnom vide.
-
-
Операторы -=, +=, и т.д. появились в версии 1.0.5. Если версия старее, то ошибка - это нормально, а вот если 1.0.5 или выше - тогда странно.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login