Subject: | Added "devicetype" to detect printers |
LINE 422: $service_hashref->{product} = $service->{att}->{product};
Added LINE 423: $service_hashref->{devicetype} = $service->{att}->{devicetype};
LINE 424: $service_hashref->{extrainfo} = $service->{att}->{extrainfo};
Example of my usage:
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Session Data #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
my $si = $np->get_session();
print "Printers Online between ".$si->start_str()
." and ".$si->time_str()."\n\n";
for my $host ( $np->all_hosts() ) {
# 80 : the HTTP port for web printers
# 443 : the HTTPS port for web printers
# 515 : the LPR/LPD port, for most printers, as well as older print-servers
# 631 : the IPP port, for most modern printers, and CUPS-based print-server
@myPorts = qw(80 443 515 631);
print $host->hostname."\t"
.$host->ipv4_addr."\t"
.$host->mac_addr;
foreach $port (@myPorts) {
print "\tPort $port: ".$host->tcp_service($port)->devicetype();
}
print "\n";
}