- $self->ut_numbern('nasnum')
- || $self->ut_text('nas')
- || $self->ut_ip('nasip')
- || $self->ut_domain('nasfqdn')
- || $self->ut_numbern('last')
- || $self->SUPER::check
- ;
-}
-
-=item heartbeat TIMESTAMP
-
-Updates the timestamp for this nas
-
-=cut
-
-sub heartbeat {
- my($self, $timestamp) = @_;
- my $dbh = dbh;
- my $sth =
- $dbh->prepare("UPDATE nas SET last = ? WHERE nasnum = ? AND last < ?");
- $sth->execute($timestamp, $self->nasnum, $timestamp) or die $sth->errstr;
- $self->last($timestamp);
+ my $error =
+ $self->ut_numbern('nasnum')
+ || $self->ut_text('nasname')
+ || $self->ut_textn('shortname')
+ || $self->ut_text('type')
+ || $self->ut_numbern('ports')
+ || $self->ut_text('secret')
+ || $self->ut_textn('server')
+ || $self->ut_textn('community')
+ || $self->ut_text('description')
+ ;
+ return $error if $error;
+
+ $self->SUPER::check;