mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	@@ -48,17 +48,19 @@ if ($device['os_group'] == 'printer') {
 | 
				
			|||||||
        $capacity = get_toner_capacity($data['prtMarkerSuppliesMaxCapacity']);
 | 
					        $capacity = get_toner_capacity($data['prtMarkerSuppliesMaxCapacity']);
 | 
				
			||||||
        $current = get_toner_levels($device, $raw_toner, $capacity);
 | 
					        $current = get_toner_levels($device, $raw_toner, $capacity);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        discover_toner(
 | 
					        if (is_numeric($current)) {
 | 
				
			||||||
            $valid_toner,
 | 
					            discover_toner(
 | 
				
			||||||
            $device,
 | 
					                $valid_toner,
 | 
				
			||||||
            $toner_oid,
 | 
					                $device,
 | 
				
			||||||
            $last_index,
 | 
					                $toner_oid,
 | 
				
			||||||
            $type,
 | 
					                $last_index,
 | 
				
			||||||
            $descr,
 | 
					                $type,
 | 
				
			||||||
            $capacity_oid,
 | 
					                $descr,
 | 
				
			||||||
            $capacity,
 | 
					                $capacity_oid,
 | 
				
			||||||
            $current
 | 
					                $capacity,
 | 
				
			||||||
        );
 | 
					                $current
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1821,8 +1821,13 @@ function get_toner_levels($device, $raw_value, $capacity)
 | 
				
			|||||||
        return 50;
 | 
					        return 50;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // -2 means unknown, -1 mean no restrictions
 | 
					    // -2 means unknown
 | 
				
			||||||
    if ($raw_value == '-2' || $raw_value == '-1') {
 | 
					    if ($raw_value == '-2') {
 | 
				
			||||||
 | 
					        return false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // -1 mean no restrictions
 | 
				
			||||||
 | 
					    if ($raw_value == '-1') {
 | 
				
			||||||
        return 0;  // FIXME: is 0 what we should return?
 | 
					        return 0;  // FIXME: is 0 what we should return?
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user