From: jweiss Date: Tue, 28 Aug 2001 02:38:20 +0000 (+0000) Subject: only output the printer's hostname. X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/26ef7fcebed57d23cb3af37a6f0773fa07cf6f34 only output the printer's hostname. --- diff --git a/gen/spwatch.gen b/gen/spwatch.gen index 6443f149..23feef07 100755 --- a/gen/spwatch.gen +++ b/gen/spwatch.gen @@ -13,18 +13,19 @@ use DBI; $dbh = DBI->connect("dbi:Oracle:moira", "moira", "moira") || exit $MR_DBMS_ERR; -$sth = $dbh->prepare("SELECT p.name, m.name, p.location FROM printers p, ". +$sth = $dbh->prepare("SELECT m.name FROM printers p, ". "machine m WHERE p.type = 'SAP' AND p.mach_id = ". - "m.mach_id ORDER BY p.name") || exit $MR_DBMS_ERR; + "m.mach_id ORDER BY m.name") || exit $MR_DBMS_ERR; $sth->execute || exit $MR_DBMS_ERR; umask 022; open(OUT, ">$outfile") || exit $MR_OCONFIG; +print OUT "# This File is automatically generated by Moira. Do not edit.\n"; -while (($name, $hostname, $location) = $sth->fetchrow_array) { +while (($hostname) = $sth->fetchrow_array) { next if $hostname eq "[NONE]"; - $row = "$name\t$hostname\t$location\n"; + $row = "$hostname\n"; $row =~ s/\0//g; print OUT $row; }