Showing 1 changed files with 8 additions and 7 deletions
+8 -7
printer
... ...
@@ -33,21 +33,19 @@ prtInputMaxCapacity=1.3.6.1.2.1.43.8.2.1.9.1
33 33
 prtInputCurrentLevel=1.3.6.1.2.1.43.8.2.1.10.1
34 34
 prtInputMediaDimFeedDirChosen=1.3.6.1.2.1.43.8.2.1.6.1
35 35
 prtInputMediaDimXFeedDirChosen=1.3.6.1.2.1.43.8.2.1.7.1
36
-for i in $(seq 2 5); do
36
+for i in 2 3; do
37 37
     snmpget -v 1 -c public $printer \
38 38
         ${prtInputMaxCapacity}.$i \
39 39
         ${prtInputCurrentLevel}.$i \
40 40
         ${prtInputMediaDimFeedDirChosen}.$i \
41
-        ${prtInputMediaDimXFeedDirChosen}.$i | awk -v inputslot=$((i - 1)) '
41
+        ${prtInputMediaDimXFeedDirChosen}.$i | awk -v inputslot=$((i - 1)) -v output=${1:-normal} '
42 42
         BEGIN {
43 43
             i = 0
44 44
             format["82667 x 116900"] = "A4 portrait / A5 paysage"
45 45
             format["116900 x 82667"] = "A4 paysage"
46 46
             format["165333 x 117000"] = "A3 paysage"
47
-            is[1] = "A"
48
-            is[2] = "B"
49
-            is[3] = "C"
50
-            is[4] = "D"
47
+            is[1] = "B"
48
+            is[2] = "A"
51 49
         }
52 50
         { 
53 51
             a[i] = $NF
... ...
@@ -56,7 +54,10 @@ for i in $(seq 2 5); do
56 54
         END {
57 55
             size = a[2] " x " a[3]
58 56
             f = format[size] ? format[size] : "format inconnu : " a[2] " x " a[3]
59
-            printf("bac %d (InputSlot=PF730%s): %d%% (%s)\n", inputslot, is[inputslot], a[1]/a[0]*100, f)
57
+	    if (output == "normal")
58
+                printf("bac %d (InputSlot=PF500%s): %d%% (%s)\n", inputslot, is[inputslot], a[1]/a[0]*100, f)
59
+            else
60
+                printf("bac %d (%s): %d%%\n", inputslot, f, a[1]/a[0]*100)
60 61
         }
61 62
     '
62 63
 done