view release on metacpan or search on metacpan
LICENSES/COPYING view on Meta::CPAN
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
LICENSES/COPYING view on Meta::CPAN
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
LICENSES/COPYING view on Meta::CPAN
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
LICENSES/IBM-LICENSE view on Meta::CPAN
5. NO WARRANTY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
responsible for determining the appropriateness of using and
distributing the Program and assumes all risks associated with its
exercise of rights under this Agreement, including but not limited to
the risks and costs of program errors, compliance with applicable
laws, damage to or loss of data, programs or equipment, and
unavailability or interruption of operations.
6. DISCLAIMER OF LIABILITY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
examples/rxdebug view on Meta::CPAN
servers => $servers,
port => $port
);
parse_results($rxdeb);
}
sub parse_results {
my $val = shift;
# if there was an error, print it and then return.
if ($AFS::CODE) {
print "Error case: ", ref($val), "\n" if (defined($val));
# die("Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n");
print "Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n";
return;
}
# print entire hash to screen
if ($showdump) {
print Dumper($val);
examples/rxdebug view on Meta::CPAN
if (exists $val->{connections}) {
for (my $i = 0; $i <= $#{$val->{connections}}; $i++) { # print each connection
print "Connection from host ", $val->{connections}->[$i]->{host},
", port ", $val->{connections}->[$i]->{port},", ";
if ($val->{connections}->[$i]->{epoch}) {
printf "Cuid %x/%x", $val->{connections}->[$i]->{epoch}, $val->{connections}->[$i]->{cid};
} else {
printf "cid %x", $val->{connections}->[$i]->{cid};
}
if ($val->{connections}->[$i]->{error}) {
print ", error ", $val->{connections}->[$i]->{error};
}
print "\n serial $val->{connections}->[$i]->{serial}, ";
print " natMTU $val->{connections}->[$i]->{natMTU}, ";
if ($val->{connections}->[$i]->{flags}) {
print "flags";
if ($val->{connections}->[$i]->{flags} & constant("RX_CONN_MAKECALL_WAITING")) {
print " MAKECALL_WAITING";
}
if ($val->{connections}->[$i]->{flags} & constant("RX_CONN_DESTROY_ME")) {
examples/rxdebug view on Meta::CPAN
print "hold, ";
}
# print call mode
print "mode: ";
if ($val->{connections}->[$i]->{callMode}->[$j] == constant("RX_MODE_SENDING")) {
print "sending";
} elsif ($val->{connections}->[$i]->{callMode}->[$j] == constant("RX_MODE_RECEIVING")) {
print "receiving";
} elsif ($val->{connections}->[$i]->{callMode}->[$j] == constant("RX_MODE_ERROR")) {
print "error";
} elsif ($val->{connections}->[$i]->{callMode}->[$j] == constant("RX_MODE_EOF")) {
print "eof";
} else {
print "unknown";
}
# print flags for this call
if ($val->{connections}->[$i]->{callFlags}->[$j]) {
printf(", flags:");
if ($val->{connections}->[$i]->{callFlags}->[$j] & constant("RX_CALL_READER_WAIT")) {
examples/xstat_cm_test view on Meta::CPAN
$_,
$rpc->{fsRPCTimes}->{$_}->{numOps}, $rpc->{fsRPCTimes}->{$_}->{numSuccesses},
$rpc->{fsRPCTimes}->{$_}->{sumTime}, $rpc->{fsRPCTimes}->{$_}->{sqrTime},
$rpc->{fsRPCTimes}->{$_}->{minTime}, $rpc->{fsRPCTimes}->{$_}->{maxTime};
}
print "\nError Info:\n-----------\n";
foreach (sort keys %{$rpc->{fsRPCErrors}}) {
printf "%15s: %d server, %d network, %d prot, %d vol, %d busies, %d other\n",
$_,
$rpc->{fsRPCErrors}->{$_}->{err_Server},
$rpc->{fsRPCErrors}->{$_}->{err_Network},
$rpc->{fsRPCErrors}->{$_}->{err_Protection},
$rpc->{fsRPCErrors}->{$_}->{err_Volume},
$rpc->{fsRPCErrors}->{$_}->{err_VolumeBusies},
$rpc->{fsRPCErrors}->{$_}->{err_Other};
}
print "\nTransfer timings:\n-----------------\n";
foreach (sort keys %{$rpc->{fsXferTimes}}) {
printf "%s: %d xfers (%d OK), time sum=%f, sqr=%f, min=%f, max=%f\n",
$_,
$rpc->{fsXferTimes}->{$_}->{numXfers}, $rpc->{fsXferTimes}->{$_}->{numSuccesses},
$rpc->{fsXferTimes}->{$_}->{sumTime},
$rpc->{fsXferTimes}->{$_}->{sqrTime},
$rpc->{fsXferTimes}->{$_}->{minTime},
pod/afsmon_stats.pod view on Meta::CPAN
=item *
numCellsContacted: Number of cells contacted.
=back
=head2 Server Up/Down Statistics Section (Server_UpDown_section)
File Server Up/Down Statistics in Same Cell Group (FS_upDown_SC_group)
Note: The records referred to in this section are the internal records kept by the afsmonitor program to track the processes from which data is being gathered.
=over
=item *
fs_sc_numTtlRecords: Number of fileserver records, active or inactive.
=item *
fs_sc_numUpRecords: Number of (active) fileserver records currently marked up.
pod/afsmon_stats.pod view on Meta::CPAN
GetXStats_max: Maximum execution time observed for GetXStats operations.
=back
File Server RPC Operation Errors Group (FS_RPCopErrors_group)
=over
=item *
FetchData_srv_err: Number of server-down errors during FetchData operations.
=item *
FetchData_net_err: Number of network errors during FetchData operations.
=item *
FetchData_prot_err_err: Number of protection violations during FetchData operations.
=item *
FetchData_vol_err: Number of volume related errors during FetchData operations.
=item *
FetchData_busy_err: Number of volume busy conditions during FetchData operations.
=item *
FetchData_other_err: Number of miscellaneous other errors during FetchData operations.
=item *
FetchACL_srv_err: Number of server-down errors during FetchACL operations.
=item *
FetchACL_net_err: Number of network errors during FetchACL operations.
=item *
FetchACL_prot_err: Number of protection violations during FetchACL operations.
=item *
FetchACL_vol_err: Number of volume related errors during FetchACL operations.
=item *
FetchACL_busy_err: Number of volume busy conditions encountered during FetchACL operations.
=item *
FetchACL_other_err: Number of miscellaneous other errors during FetchACL operations.
=item *
FetchStatus_srv_err: Number of server-down errors during FetchStatus operations.
=item *
FetchStatus_net_err: Number of network errors during FetchStatus operations.
=item *
FetchStatus_prot_err: Number of protection violations during FetchStatus operations.
=item *
FetchStatus_vol_err: Number of volume related errors during FetchStatus operations.
=item *
FetchStatus_busy_err: Number of volume busy conditions encountered during FetchStatus operations.
=item *
FetchStatus_other_err: Number of miscellaneous other errors during FetchStatus operations.
=item *
StoreData_srv_err: Number of server-down errors during StoreData operations.
=item *
StoreData_net_err: Number of network errors during StoreData operations.
=item *
StoreData_prot_err: Number of protection violations during StoreData operations.
=item *
StoreData_vol_err: Number of volume related errors during StoreData operations.
=item *
StoreData_busy_err: Number of volume busy conditions encountered during StoreData operations.
=item *
StoreData_other_err: Number of miscellaneous other errors during StoreData operations.
=item *
StoreACL_srv_err: Number of server-down errors during StoreACL operations.
=item *
StoreACL_net_err: Number of network errors during StoreACL operations.
=item *
StoreACL_prot_err: Number of protection violations during StoreACL operations.
=item *
StoreACL_vol_err: Number of volume related errors during StoreACL operations.
=item *
StoreACL_busy_err: Number of volume busy conditions encountered during StoreACL operations.
=item *
StoreACL_other_err: Number of miscellaneous other errors during StoreACL operations.
=item *
StoreStatus_srv_err: Number of server-down errors during StoreStatus operations.
=item *
StoreStatus_net_err: Number of network errors during StoreStatus operations.
=item *
StoreStatus_prot_err: Number of protection violations during StoreStatus operations.
=item *
StoreStatus_vol_err: Number of volume related errors during StoreStatus operations.
=item *
StoreStatus_busy_err: Number of volume busy conditions encountered during StoreStatus operations.
=item *
StoreStatus_other_err: Number of miscellaneous other errors during StoreStatus operations.
=item *
RemoveFile_srv_err: Number of server-down errors during RemoveFile operations.
=item *
RemoveFile_net_err: Number of network errors during RemoveFile operations.
=item *
RemoveFile_prot_err: Number of protection violations during RemoveFile operations.
=item *
RemoveFile_vol_err: Number of volume related errors during RemoveFile operations.
=item *
RemoveFile_busy_err: Number of volume busy conditions encountered during RemoveFile operations.
=item *
RemoveFile_other_err: Number of miscellaneous other errors during RemoveFile operations.
=item *
CreateFile_srv_err: Number of server-down errors during CreateFile operations.
=item *
CreateFile_net_err: Number of network errors during CreateFile operations.
=item *
CreateFile_prot_err: Number of protection violations during CreateFile operations.
=item *
CreateFile_vol_err: Number of volume related errors during CreateFile operations.
=item *
CreateFile_busy_err: Number of volume busy conditions encountered during CreateFile operations.
=item *
CreateFile_other_err: Number of miscellaneous other errors during CreateFile operations.
=item *
Rename_srv_err: Number of server-down errors during Rename operations.
=item *
Rename_net_err: Number of network errors during Rename operations.
=item *
Rename_prot_err: Number of protection violations during Rename operations.
=item *
Rename_vol_err: Number of volume related errors during Rename operations.
=item *
Rename_busy_err: Number of volume busy conditions encountered during Rename operations.
=item *
Rename_other_err: Number of miscellaneous other errors during Rename operations.
=item *
Symlink_srv_err: Number of server-down errors during Symlink operations.
=item *
Symlink_net_err: Number of network errors during Symlink operations.
=item *
Symlink_prot_err: Number of protection violations during Symlink operations.
=item *
Symlink_vol_err: Number of volume related errors during Symlink operations.
=item *
Symlink_busy_err: Number of volume busy conditions encountered during Symlink operations.
=item *
Symlink_other_err: Number of miscellaneous other errors during Symlink operations.
=item *
Link_srv_err: Number of server-down errors during Link operations.
=item *
Link_net_err: Number of network errors during Link operations.
=item *
Link_prot_err: Number of protection violations during Link operations.
=item *
Link_vol_err: Number of volume related errors during Link operations.
=item *
Link_busy_err: Number of volume busy conditions encountered during Link operations.
=item *
Link_other_err: Number of miscellaneous other errors during Link operations.
=item *
MakeDir_srv_err: Number of server-down errors during MakeDir operations.
=item *
MakeDir_net_err: Number of network errors during MakeDir operations.
=item *
MakeDir_prot_err: Number of protection violations during MakeDir operations.
=item *
MakeDir_vol_err: Number of volume related errors during MakeDir operations.
=item *
MakeDir_busy_err: Number of volume busy conditions encountered during MakeDir operations.
=item *
MakeDir_other_err: Number of miscellaneous other errors during MakeDir operations.
=item *
RemoveDir_srv_err: Number of server-down errors during RemoveDir operations.
=item *
RemoveDir_net_err: Number of network errors during RemoveDir operations.
=item *
RemoveDir_prot_err: Number of protection violations during RemoveDir operations.
=item *
RemoveDir_vol_err: Number of volume related errors during RemoveDir operations.
=item *
RemoveDir_busy_err: Number of volume busy conditions encountered during RemoveDir operations.
=item *
RemoveDir_other_err: Number of miscellaneous other errors during RemoveDir operations.
=item *
SetLock_srv_err: Number of server-down errors during SetLock operations.
=item *
SetLock_net_err: Number of network errors during SetLock operations.
=item *
SetLock_prot_err: Number of protection violations during SetLock operations.
=item *
SetLock_vol_err: Number of volume related errors during SetLock operations.
=item *
SetLock_busy_err: Number of volume busy conditions encountered during SetLock operations.
=item *
SetLock_other_err: Number of miscellaneous other errors during SetLock operations.
=item *
ExtendLock_srv_err: Number of server-down errors during ExtendLock operations.
=item *
ExtendLock_net_err: Number of network errors during ExtendLock operations.
=item *
ExtendLock_prot_err: Number of protection violations during ExtendLock operations.
=item *
ExtendLock_vol_err: Number of volume related errors during ExtendLock operations.
=item *
ExtendLock_busy_err: Number of volume busy conditions encountered during ExtendLock operations.
=item *
ExtendLock_other_err: Number of miscellaneous other errors during ExtendLock operations.
=item *
ReleaseLock_srv_err: Number of server-down errors during ReleaseLock operations.
=item *
ReleaseLock_net_err: Number of network errors during ReleaseLock operations.
=item *
ReleaseLock_prot_err: Number of protection violations during ReleaseLock operations.
=item *
ReleaseLock_vol_err: Number of volume related errors during ReleaseLock operations.
=item *
ReleaseLock_busy_err: Number of volume busy conditions encountered during ReleaseLock operations.
=item *
ReleaseLock_other_err: Number of miscellaneous other errors during ReleaseLock operations.
=item *
GetStatistics_srv_err: Number of server-down errors during GetStatistics operations.
=item *
GetStatistics_net_err: Number of network errors during GetStatistics operations.
=item *
GetStatistics_prot_err: Number of protection violations during GetStatistics operations.
=item *
GetStatistics_vol_err: Number of volume related errors during GetStatistics operations.
=item *
GetStatistics_busy_err: Number of volume busy conditions encountered during GetStatistics operations.
=item *
GetStatistics_other_err: Number of miscellaneous other errors during GetStatistics operations.
=item *
GiveUpCallbacks_srv_err: Number of server-down errors during GiveUpCallbacks operations.
=item *
GiveUpCallbacks_net_err: Number of network errors during GiveUpCallbacks operations.
=item *
GiveUpCallbacks_prot_err: Number of protection violations during GiveUpCallbacks operations.
=item *
GiveUpCallbacks_vol_err: Number of volume related errors during GiveUpCallbacks operations.
=item *
GiveUpCallbacks_busy_err: Number of volume busy conditions encountered during GiveUpCallbacks operations.
=item *
GiveUpCallbacks_other_err: Number of miscellaneous other errors during GiveUpCallbacks operations.
=item *
GetVolumeInfo_srv_err: Number of server-down errors during GetVolumeInfo operations.
=item *
GetVolumeInfo_net_err: Number of network errors during GetVolumeInfo operations.
=item *
GetVolumeInfo_prot_err: Number of protection violations during GetVolumeInfo operations.
=item *
GetVolumeInfo_vol_err: Number of volume related errors during GetVolumeInfo operations.
=item *
GetVolumeInfo_busy_err: Number of volume busy conditions encountered during GetVolumeInfo operations.
=item *
GetVolumeInfo_other_err: Number of miscellaneous other errors during GetVolumeInfo operations.
=item *
GetVolumeStatus_srv_err: Number of server-down errors during GetVolumeStatus operations.
=item *
GetVolumeStatus_net_err: Number of network errors during GetVolumeStatus operations.
=item *
GetVolumeStatus_prot_err: Number of protection violations during GetVolumeStatus operations.
=item *
GetVolumeStatus_vol_err: Number of volume related errors during GetVolumeStatus operations.
=item *
GetVolumeStatus_busy_err: Number of volume busy conditions encountered during GetVolumeStatus operations.
=item *
GetVolumeStatus_other_err: Number of miscellaneous other errors during GetVolumeStatus operations.
=item *
SetVolumeStatus_srv_err : Number of server-down errors during SetVolumeStatus operations.
=item *
SetVolumeStatus_net_err: Number of network errors during SetVolumeStatus operations.
=item *
SetVolumeStatus_prot_err: Number of protection violations during SetVolumeStatus operations.
=item *
SetVolumeStatus_vol_err: Number of volume related errors during SetVolumeStatus operations.
=item *
SetVolumeStatus_busy_err: Number of volume busy conditions encountered during SetVolumeStatus operations.
=item *
SetVolumeStatus_other_err: Number of miscellaneous other errors during SetVolumeStatus operations.
=item *
GetRootVolume_srv_err: Number of server-down errors during GetRootVolume operations.
=item *
GetRootVolume_net_err: Number of network errors during GetRootVolume operations.
=item *
GetRootVolume_prot_err: Number of protection violations during GetRootVolume operations.
=item *
GetRootVolume_vol_err: Number of volume related errors during GetRootVolume operations.
=item *
GetRootVolume_busy_err: Number of volume busy conditions encountered during GetRootVolume operations.
=item *
GetRootVolume_other_err: Number of miscellaneous other errors during GetRootVolume operations.
=item *
CheckToken_srv_err: Number of server-down errors during CheckToken operations.
=item *
CheckToken_net_err: Number of network errors during CheckToken operations.
=item *
CheckToken_prot_err: Number of protection violations during CheckToken operations.
=item *
CheckToken_vol_err: Number of volume related errors during CheckToken operations.
=item *
CheckToken_busy_err: Number of volume busy conditions encountered during CheckToken operations.
=item *
CheckToken_other_err: Number of miscellaneous other errors during CheckToken operations.
=item *
GetTime_srv_err: Number of server-down errors during GetTime operations.
=item *
GetTime_net_err: Number of network errors during GetTime operations.
=item *
GetTime_prot_err: Number of protection violations during GetTime operations.
=item *
GetTime_vol_err: Number of volume related errors during GetTime operations.
=item *
GetTime_busy_err: Number of volume busy conditions encountered during GetTime operations.
=item *
GetTime_other_err: Number of miscellaneous other errors during GetTime operations.
=item *
NGetVolumeInfo_srv_err: Number of server-down errors during NGetVolumeInfo operations.
=item *
NGetVolumeInfo_net_err: Number of network errors during NGetVolumeInfo operations.
=item *
NGetVolumeInfo_prot_err: Number of protection violations during NGetVolumeInfo operations.
=item *
NGetVolumeInfo_vol_err: Number of volume related errors during NGetVolumeInfo operations.
=item *
NGetVolumeInfo_busy_err: Number of volume busy conditions encountered during NGetVolumeInfo operations.
=item *
NGetVolumeInfo_other_err: Number of miscellaneous other errors during NGetVolumeInfo operations.
=item *
BulkStatus_srv_err: Number of server-down errors during BulkStatus operations.
=item *
BulkStatus_net_err: Number of network errors during BulkStatus operations.
=item *
BulkStatus_prot_err: Number of protection violations during BulkStatus operations.
=item *
BulkStatus_vol_err: Number of volume related errors during BulkStatus operations.
=item *
BulkStatus_busy_err: Number of volume busy conditions encountered during BulkStatus operations.
=item *
BulkStatus_other_err: Number of miscellaneous other errors during BulkStatus operations.
=item *
XStatsVersion_srv_err: Number of server-down errors during XStatsVersion operations.
=item *
XStatsVersion_net_err: Number of network errors during XStatsVersion operations.
=item *
XStatsVersion_prot_err: Number of protection violations during XStatsVersion operations.
=item *
XStatsVersion_vol_err: Number of volume related errors during XStatsVersion operations.
=item *
XStatsVersion_busy_err: Number of volume busy conditions encountered during XStatsVersion operations.
=item *
XStatsVersion_other_err: Number of miscellaneous other errors during XStatsVersion operations.
=item *
GetXStats_srv_err: Number of server-down errors during GetXStats operations.
=item *
GetXStats_net_err: Number of network errors during GetXStats operations.
=item *
GetXStats_prot_err: Number of protection violations during GetXStats operations.
=item *
GetXStats_vol_err: Number of volume related errors during GetXStats operations.
=item *
GetXStats_busy_err: Number of volume busy conditions encountered during GetXStats operations.
=item *
GetXStats_other_err: Number of miscellaneous other errors during GetXStats operations.
=back
File Server RPC Transfer Timings Group (FS_RPCopBytes_group)
=over
=item *
FetchData_xfers: Number of FetchData operations.
pod/afsmon_stats.pod view on Meta::CPAN
=item *
FetchData_xfers_min: Minimum transfer time observed for FetchData operations.
=item *
FetchData_xfers_max: Maximum transfer time observed for FetchData operations.
=item *
FetchData_xfers_bytes_sum: Sum of bytes transferred for FetchData operations.
=item *
FetchData_xfers_bytes_min: Minimum byte transfer observed for FetchData operations.
=item *
FetchData_xfers_bytes_max: Maximum byte transfer observed for FetchData operations.
=item *
pod/afsmon_stats.pod view on Meta::CPAN
=item *
StoreData_xfers_min: Minimum transfer time observed for StoreData operations.
=item *
StoreData_xfers_max: Maximum transfer time observed for StoreData operations.
=item *
StoreData_xfers_bytes_sum: Sum of bytes transferred for StoreData operations.
=item *
StoreData_xfers_bytes_min: Minimum byte transfer observed for StoreData operations.
=item *
StoreData_xfers_bytes_max: Maximum byte transfer observed for StoreData operations.
=item *
pod/afsmon_stats.pod view on Meta::CPAN
=item *
FetchData_xfers_min: Minimum transfer time observed for FetchData operations.
=item *
FetchData_xfers_max: Maximum transfer time observed for FetchData operations.
=item *
FetchData_xfers_bytes_sum: Sum of bytes transferred for FetchData operations.
=item *
FetchData_xfers_bytes_min: Minimum byte transfer observed for FetchData operations.
=item *
FetchData_xfers_bytes_max: Maximum byte transfer observed for FetchData operations.
=item *
pod/afsmon_stats.pod view on Meta::CPAN
=item *
StoreData_xfers_min: Minimum transfer time observed for StoreData operations.
=item *
StoreData_xfers_max: Maximum transfer time observed for StoreData operations.
=item *
StoreData_xfers_bytes_sum: Sum of bytes transferred for StoreData operations.
=item *
StoreData_xfers_bytes_min: Minimum byte transfer observed for StoreData operations.
=item *
StoreData_xfers_bytes_max: Maximum byte transfer observed for StoreData operations.
=item *
pod/afsmonitor.pod view on Meta::CPAN
field_name that equals or exceeds the threshold value.
Use the thresh line to set either a global threshold, which applies
to all file server machines listed on fs lines or client machines
listed on cm lines in the configuration file, or a machine-specific
threshold, which applies to only one file server or client machine.
To set a global threshold, place the thresh line before any of the
fs or cm lines in the file. To set a machine-specific threshold,
place the thresh line below the corresponding fs or cm line, and
above any other fs or cm lines. A machine-specific threshold value
always overrides the corresponding global threshold, if set. Do not
place a thresh fs line directly after a cm line or a thresh cm line
directly after a fs line.
=item B<show fs | cm I<field/group/section>>
Specifies which individual statistic, group of statistics, or
section of statistics to include in the File Servers (fs) and/or
Cache Managers (cm) data structure. The L<afsmon_stats(1)> documentation
specifies the group and section to which each statistic belongs.
Include as many show lines as necessary to customize the results
src/Makefile.PL view on Meta::CPAN
-lrxkad
-lrxstat
-lxstat_fs
-lxstat_cm
-lafsint
-lrx
-lsys
-ldes
-llwp
-lcom_err
-lutil
-lusd
-laudit
)
)
],
'realclean' => {FILES => 'Makefile.bak lib'},
);
if ($Config{osname} =~ /aix/) {
src/Makefile.PL view on Meta::CPAN
WriteMakefile(%MakefileArgs);
# change the library name of the AFS system library "util.a"
my $command = "\'s#-lutil#$AFSPath/lib/afs/util.a#\'";
system("perl -p -i.bak -e $command Makefile") unless -f "$AFSPath/lib/afs/libutil.a";
# change the library name of the AFS system library "vlib.a"
$command = "\'s#-lvlib#$AFSPath/lib/afs/vlib.a#\'";
system("perl -p -i.bak -e $command Makefile") unless -f "$AFSPath/lib/afs/libvlib.a";
# change the library name of the AFS system library "libcom_err"
$command = "\'s#-lcom_err#$AFSPath/lib/afs/libcom_err.a#\'";
system("perl -p -i.bak -e $command Makefile");
# change the library name of the AFS system library "libsys"
$command = "\'s#-lsys#$AFSPath/lib/afs/libsys.a#\'";
system("perl -p -i.bak -e $command Makefile");
# change the library name of the AFS system library "libcmd"
$command = "\'s#-lcmd#$AFSPath/lib/afs/libcmd.a#\'";
system("perl -p -i.bak -e $command Makefile");
src/Monitor.pm view on Meta::CPAN
udebug
cmdebug
scout
xstat_fs_test
xstat_cm_test
);
# Other items we are prepared to export if requested
@EXPORT_OK = qw(
error_message
constant
);
sub rxdebug {
my %subreq;
# parse the arguments and build a hash to pass to the XS do_rxdebug call.
return eval {
while (@_) {
$_ = shift;
src/Monitor.xs view on Meta::CPAN
#if defined(AFS_3_4) || defined(AFS_3_5)
#else
#define int32 afs_int32
#define uint32 afs_uint32
#endif
const char *const xs_version = "Monitor.xs (Major Version 0.2 $Rev: 609 $)";
extern char *error_message();
extern struct hostent *hostutil_GetHostByName();
extern char *hostutil_GetNameByINet();
/* error handling macros */
#define SETCODE(code) set_code(code)
#define FSSETCODE(code) {if (code == -1) set_code(errno); else set_code(code);}
#define BSETCODE(code, msg) bv_set_code(code, msg)
#define VSETCODE(code, msg) bv_set_code(code, msg)
static int32 raise_exception = 0;
static void
bv_set_code(code, msg)
int32 code;
const char *msg;
src/Monitor.xs view on Meta::CPAN
int32 code;
{
SV *sv = perl_get_sv("AFS::CODE", TRUE);
sv_setiv(sv, (IV) code);
if (code == 0) {
sv_setpv(sv, "");
}
else {
if (raise_exception) {
char buffer[1024];
sprintf(buffer, "AFS exception: %s (%d)", error_message(code), code);
croak(buffer);
}
sv_setpv(sv, (char *)error_message(code));
}
SvIOK_on(sv);
}
/* end of error handling macros */
/* start of rxdebug helper functions */
/*
* from src/rxdebug/rxdebug.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
src/Monitor.xs view on Meta::CPAN
*/
int
my_parse_threshEntry(a_line, global_fsThreshCount, global_cmThreshCount,
last_hostEntry, lastHostType, buffer)
char *a_line; /* line that is being parsed */
int *global_fsThreshCount; /* count of global file server thresholds */
int *global_cmThreshCount; /* count of global cache manager thresholds */
struct afsmon_hostEntry *last_hostEntry; /* a pointer to the last host entry */
int lastHostType; /* points to an integer specifying whether the last host was fs or cm */
char *buffer; /* to return error messages in */
{
char opcode[CFG_STR_LEN]; /* junk characters */
char arg1[CFG_STR_LEN]; /* hostname or qualifier (fs/cm?) */
char arg2[CFG_STR_LEN]; /* threshold variable */
char arg3[CFG_STR_LEN]; /* threshold value */
char arg4[CFG_STR_LEN]; /* user's handler */
char arg5[CFG_STR_LEN]; /* junk characters */
/* break it up */
src/Monitor.xs view on Meta::CPAN
(*global_fsThreshCount)++;
break;
case 1: /* inc thresh count of last file server */
last_hostEntry->numThresh++;
break;
case 2:
sprintf(buffer,
"A threshold for a File Server cannot be placed after a Cache Manager host entry in the config file");
return (-1);
default:
sprintf(buffer, "Programming error 1");
return (-1);
}
}
else if ((strcasecmp(arg1, "cm")) == 0) {
switch (lastHostType) {
case 0: /* its a global threshold */
(*global_cmThreshCount)++;
break;
case 2: /* inc thresh count of last cache manager */
last_hostEntry->numThresh++;
break;
case 1:
sprintf(buffer,
"A threshold for a Cache Manager cannot be placed after a File Server host entry in the config file");
return (-1);
default:
sprintf(buffer, "Programming error 2");
return (-1);
}
}
else {
sprintf(buffer,
"Syntax error. Second argument should be \"fs\" or \"cm\"");
return (-1);
}
return (0);
} /* my_parse_threshEntry() */
/*
* from src/afsmonitor/afsmonitor.c
src/Monitor.xs view on Meta::CPAN
tmp_host = tmp_host->next;
}
(*global_TC)--;
return (0);
}
/* it is not a global threshold, insert it in the thresh list of this
* host only. We overwrite the global threshold if it was already set */
if (*hostname == '\0') {
sprintf(buffer, "Programming error 3");
return (-1);
}
/* get the hostEntry that this threshold belongs to */
tmp_host = Header;
found = 0;
for (i = 0; i < srvCount; i++) {
if (strcasecmp(tmp_host->hostName, hostname) == 0) {
found = 1;
break;
src/Monitor.xs view on Meta::CPAN
int *numCM;
int *lastHostType;
struct afsmon_hostEntry **last_hostEntry;
int *fs_showDefault;
int *cm_showDefault;
short *fs_showFlags;
short *cm_showFlags;
struct afsmon_hostEntry **FSnameList;
struct afsmon_hostEntry **CMnameList;
{
char buff1[256] = ""; /* for error messages */
char buff2[256] = ""; /* for error messages returned from subroutines */
FILE *configFD = 0; /* config file descriptor */
char line[4 * CFG_STR_LEN]; /* a line of config file */
char opcode[CFG_STR_LEN]; /* specifies type of config entry */
char arg1[CFG_STR_LEN]; /* hostname or qualifier (fs/cm?) */
char arg2[CFG_STR_LEN]; /* threshold variable */
char arg3[CFG_STR_LEN]; /* threshold value */
char arg4[CFG_STR_LEN]; /* user's handler */
struct afsmon_hostEntry *curr_host = 0;
struct hostent *he = 0; /* hostentry to resolve host name */
char *handlerPtr = 0; /* ptr to pass theresh handler string */
int code = 0; /* error code */
int linenum = 0; /* config file line number */
int threshCount = 0; /* count of thresholds for each server */
int error_in_config = 0; /* syntax errors in config file ?? */
int i = 0;
int numBytes = 0;
/* int global_ThreshFlag = 1; */
int global_fsThreshCount = 0;
int global_cmThreshCount = 0;
static char last_fsHost[HOST_NAME_LEN];
static char last_cmHost[HOST_NAME_LEN];
/* open config file */
configFD = fopen(a_config_filename, "r");
src/Monitor.xs view on Meta::CPAN
return (-1);
}
/* parse config file */
/* First Pass - check syntax and count number of servers and thresholds to monitor */
*numFS = 0;
*numCM = 0;
threshCount = 0;
error_in_config = 0; /* flag to note if config file has syntax errors */
while ((fgets(line, CFG_STR_LEN, configFD)) != NULL) {
opcode[0] = 0;
arg1[0] = 0;
arg2[0] = 0;
arg3[0] = 0;
arg4[0] = 0;
sscanf(line, "%s %s %s %s %s", opcode, arg1, arg2, arg3, arg4);
linenum++;
/* fprintf(STDERR, "Got line %d: \"%s %s %s %s %s\"\n",
src/Monitor.xs view on Meta::CPAN
else {
/* fprintf(STDERR, " - unknown entry\n"); */
sprintf(buff2, "Unknown opcode %s", opcode);
code = 1;
}
if (code) {
sprintf(buff1,
"Error processing config file line %d (\"%s %s %s %s %s\"). %s",
linenum, opcode, arg1, arg2, arg3, arg4, buff2);
error_in_config = 1;
BSETCODE(10, buff1);
return (-1);
}
}
/* fprintf(STDERR, "got to end of file.\n"); */
if (error_in_config) {
sprintf(buff1, "Error in config file. %s", buff2);
BSETCODE(10, buff1);
return (-1);
}
/* the threshold count of all hosts in increased by 1 for each global
* threshold. If one of the hosts has a local threshold for the same
* variable it would end up being counted twice. whats a few bytes of memory
* wasted anyway ? */
src/Monitor.xs view on Meta::CPAN
/* Second Pass */
fseek(configFD, 0, 0); /* seek to the beginning */
/* allocate memory for threshold lists */
curr_host = *FSnameList;
for (i = 0; i < *numFS; i++) {
if (curr_host->hostName[0] == '\0') {
sprintf(buff1, "Programming error 4");
BSETCODE(20, buff1);
return (-1);
}
if (curr_host->numThresh) {
numBytes = curr_host->numThresh * sizeof(struct Threshold);
curr_host->thresh = (struct Threshold *)malloc(numBytes);
if (curr_host->thresh == (struct Threshold *) NULL) {
sprintf(buff1, "Memory Allocation error 1");
BSETCODE(25, buff1);
return (-1);
}
memset(curr_host->thresh, 0, numBytes);
}
curr_host = curr_host->next;
}
curr_host = *CMnameList;
for (i = 0; i < *numCM; i++) {
if (curr_host->hostName[0] == '\0') {
sprintf(buff1, "Programming error 5");
BSETCODE(30, buff1);
return (-1);
}
if (curr_host->numThresh) {
numBytes = curr_host->numThresh * sizeof(struct Threshold);
curr_host->thresh = (struct Threshold *)malloc(numBytes);
if (curr_host->thresh == (struct Threshold *) NULL) {
sprintf(buff1, "Memory Allocation error 2");
BSETCODE(35, buff1);
return (-1);
}
memset(curr_host->thresh, 0, numBytes);
}
curr_host = curr_host->next;
}
opcode[0] = 0;
arg1[0] = 0;
src/Monitor.xs view on Meta::CPAN
&global_fsThreshCount, *FSnameList,
last_fsHost, *numFS, buff2);
else if (strcasecmp(arg1, "cm") == 0)
code = my_store_threshold(2, /* 2 = cm */
arg2, arg3, handlerPtr,
&global_cmThreshCount, *CMnameList,
last_cmHost, *numCM, buff2);
else {
sprintf(buff1, "Programming error 6");
BSETCODE(40, buff1);
return (-1);
}
if (code) {
sprintf(buff1,
"Error processing config file line %d (\"%s %s %s %s %s\"): Failed to store threshold. %s",
linenum, opcode, arg1, arg2, arg3, arg4, buff2);
BSETCODE(45, buff1);
return (-1);
}
src/Monitor.xs view on Meta::CPAN
*currCollIDP,
&srvVersionNumber,
&(xstat_fs_Results.probeTime),
&(xstat_fs_Results.data));
code =
ProbeHandler(xstat_fs_Results, xstat_fs_numServers, index,
buff2, argp);
index++;
if (code) {
sprintf(buffer, "Handler returned error code %d. %s",
code, buff2);
return (code);
}
} /* For each collection */
} /*Valid Rx connection */
/*
* Advance the xstat_fs connection pointer.
*/
src/Monitor.xs view on Meta::CPAN
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
int
my_xstat_fs_Init(int (*ProbeHandler) (), int xstat_fs_numServers,
struct sockaddr_in *a_socketArray,
int xstat_fs_numCollections, afs_int32 * xstat_fs_collIDP,
char *buffer, ...)
{
int curr_srv = 0;
int conn_err = 0;
char *hostNameFound = "";
struct xstat_fs_ConnectionInfo *curr_conn = 0, *xstat_fs_ConnInfo = 0;
struct rx_securityClass *secobj = 0; /*Client security object */
char buff2[256] = "";
int PortToUse = 0;
int code = 0;
va_list argp;
xstat_fs_ConnInfo = (struct xstat_fs_ConnectionInfo *)
malloc(xstat_fs_numServers * sizeof(struct xstat_fs_ConnectionInfo));
src/Monitor.xs view on Meta::CPAN
PortToUse = XSTAT_FS_CBPORT;
do {
code = rx_Init(htons(PortToUse));
if (code) {
if (code == RX_ADDRINUSE) {
PortToUse++;
}
else {
sprintf(buffer, "Fatal error in rx_Init()");
return (-1);
}
}
} while (code);
/*
* Create a null Rx client security object, to be used by the
* probe LWP.
*/
secobj = rxnull_NewClientSecurityObject();
if (secobj == (struct rx_securityClass *) NULL) {
/*Delete already-malloc'ed areas */
my_xstat_fs_Cleanup(1, xstat_fs_numServers, xstat_fs_ConnInfo, buff2);
sprintf(buffer, "Can't create probe LWP client security object. %s",
buff2);
return (-1);
}
curr_conn = xstat_fs_ConnInfo;
conn_err = 0;
for (curr_srv = 0; curr_srv < xstat_fs_numServers; curr_srv++) {
/*
* Copy in the socket info for the current server, resolve its
* printable name if possible.
*/
memcpy(&(curr_conn->skt), a_socketArray + curr_srv,
sizeof(struct sockaddr_in));
hostNameFound = hostutil_GetNameByINet(curr_conn->skt.sin_addr.s_addr);
src/Monitor.xs view on Meta::CPAN
void
my_Print_cm_ErrInfo(a_opIdx, a_opNames, a_opErrP, cm_outFD)
int a_opIdx;
char *a_opNames[];
struct afs_stats_RPCErrors *a_opErrP;
FILE *cm_outFD;
{ /*Print_cm_ErrInfo */
fprintf(cm_outFD,
"%15s: %d server, %d network, %d prot, %d vol, %d busies, %d other\n",
a_opNames[a_opIdx], a_opErrP->err_Server, a_opErrP->err_Network,
a_opErrP->err_Protection, a_opErrP->err_Volume,
a_opErrP->err_VolumeBusies, a_opErrP->err_Other);
} /* my_Print_cm_ErrInfo() */
/*
* from src/afsmonitor/afsmon-output.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
src/Monitor.xs view on Meta::CPAN
int idx;
afs_int32 numLongs;
fullP = (struct afs_stats_CMFullPerf *)
(a_cmResults->data.AFSCB_CollData_val);
/* There are 4 parts to CM statistics
* - Overall performance statistics (including up/down statistics)
* - This CMs FS RPC operations info
* - This CMs FS RPC errors info
* - This CMs FS transfers info
* - Authentication info
* - [Un]Replicated access info
*/
/* copy overall performance statistics */
srcbuf = (afs_int32 *) & (fullP->perf);
idx = 0;
src/Monitor.xs view on Meta::CPAN
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* max time */
sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
}
/*printf("Ending index value = %d\n",idx-1); */
/* copy CMs individual FS RPC errors info */
srcbuf = (afs_int32 *) (fullP->rpc.fsRPCErrors);
for (i = 0; i < AFS_STATS_NUM_FS_RPC_OPS; i++) {
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* server */
idx++;
srcbuf++;
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* network */
idx++;
srcbuf++;
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* prot */
src/Monitor.xs view on Meta::CPAN
&srvVersionNumber,
&(xstat_cm_Results.probeTime),
&(xstat_cm_Results.data));
code =
ProbeHandler(xstat_cm_Results, xstat_cm_numServers, index,
buff2, argp);
index++;
if (code) {
sprintf(buffer, "Handler routine got error code %d. %s",
code, buff2);
return (code);
}
} /* For each collection */
} /*Valid Rx connection */
/*
* Advance the xstat_fs connection pointer.
*/
src/Monitor.xs view on Meta::CPAN
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
int
my_xstat_cm_Init(int (*ProbeHandler) (), int xstat_cm_numServers,
struct sockaddr_in *a_socketArray,
int xstat_cm_numCollections, afs_int32 * xstat_cm_collIDP,
char *buffer, ...)
{
int curr_srv = 0;
int conn_err = 0;
char *hostNameFound = "";
struct xstat_cm_ConnectionInfo *curr_conn = 0, *xstat_cm_ConnInfo = 0;
struct rx_securityClass *secobj = 0; /*Client security object */
char buff2[256] = "";
int code = 0;
va_list argp;
xstat_cm_ConnInfo = (struct xstat_cm_ConnectionInfo *)
malloc(xstat_cm_numServers * sizeof(struct xstat_cm_ConnectionInfo));
if (xstat_cm_ConnInfo == (struct xstat_cm_ConnectionInfo *) NULL) {
sprintf(buffer,
"Can't allocate %d connection info structs (%d bytes)",
xstat_cm_numServers,
(xstat_cm_numServers * sizeof(struct xstat_cm_ConnectionInfo)));
return (-1); /*No cleanup needs to be done yet */
}
code = rx_Init(htons(0));
if (code) {
sprintf(buffer, "Fatal error in rx_Init(), error=%d", code);
return (-1);
}
/*
* Create a null Rx client security object, to be used by the
* probe LWP.
*/
secobj = rxnull_NewClientSecurityObject();
if (secobj == (struct rx_securityClass *) NULL) {
/*Delete already-malloc'ed areas */
my_xstat_cm_Cleanup(1, xstat_cm_numServers, xstat_cm_ConnInfo, buff2);
sprintf(buffer, "Can't create probe LWP client security object. %s",
buff2);
return (-1);
}
curr_conn = xstat_cm_ConnInfo;
conn_err = 0;
for (curr_srv = 0; curr_srv < xstat_cm_numServers; curr_srv++) {
/*
* Copy in the socket info for the current server, resolve its
* printable name if possible.
*/
memcpy(&(curr_conn->skt), a_socketArray + curr_srv,
sizeof(struct sockaddr_in));
hostNameFound = hostutil_GetNameByINet(curr_conn->skt.sin_addr.s_addr);
src/Monitor.xs view on Meta::CPAN
struct AFSDBLock lock;
afs_int32 code;
HV *LOCK;
HV *LOCKDESC;
for (i = 0; i < 1000; i++) {
code = RXAFSCB_GetLock(aconn, i, &lock);
if (code) {
if (code == 1)
break;
/* otherwise we have an unrecognized error */
sprintf(buffer, "cmdebug: error checking locks: %s",
error_message(code));
return code;
}
/* here we have the lock information, so display it, perhaps */
if (aint32 || IsLocked(&lock.lock)) {
LOCK = newHV();
hv_store(LOCK, "name", 4, newSVpv(lock.name, 0), 0);
LOCKDESC = newHV();
my_PrintLock(&lock.lock, LOCKDESC);
hv_store(LOCK, "lock", 4, newRV_inc((SV *) LOCKDESC), 0);
av_store(LOCKS, i, newRV_inc((SV *) LOCK));
src/Monitor.xs view on Meta::CPAN
HV *NETFID;
HV *CENTRY;
HV *LOCK;
for (i = 0; i < 10000; i++) {
code = RXAFSCB_GetCE(aconn, i, ¢ry);
if (code) {
if (code == 1)
break;
sprintf(buffer, "cmdebug: failed to get cache entry %d (%s)", i,
error_message(code));
return code;
}
CENTRY = newHV();
hv_store(CENTRY, "addr", 4, newSViv(centry.addr), 0);
if (centry.addr == 0) {
/* PS output */
NETFID = newHV();
src/Monitor.xs view on Meta::CPAN
HV *NETFID;
HV *CENTRY;
HV *LOCK;
for (i = 0; i < 10000; i++) {
code = RXAFSCB_GetCE(aconn, i, ¢ry);
if (code) {
if (code == 1)
break;
sprintf(buffer, "cmdebug: failed to get cache entry %d (%s)\n", i,
error_message(code));
return code;
}
CENTRY = newHV();
hv_store(CENTRY, "addr", 4, newSViv(centry.addr), 0);
if (centry.addr == 0) {
/* PS output */
printf("Proc %4d sleeping at %08x, pri %3d\n",
src/Monitor.xs view on Meta::CPAN
HV *NETFID;
HV *CENTRY;
HV *LOCK;
for (i = 0; i < 10000; i++) {
code = RXAFSCB_GetCE64(aconn, i, ¢ry);
if (code) {
if (code == 1)
break;
sprintf(buffer, "cmdebug: failed to get cache entry %d (%s)\n", i,
error_message(code));
return code;
}
CENTRY = newHV();
hv_store(CENTRY, "addr", 4, newSViv(centry.addr), 0);
if (centry.addr == 0) {
/* PS output */
NETFID = newHV();
src/Monitor.xs view on Meta::CPAN
int a_numServers;
struct sockaddr_in *a_socketArray;
AV *RETVAL;
FILE *scout_debugfd;
char *buffer;
{
static char rn[] = "my_fsprobe_Init";
struct fsprobe_ConnectionInfo *curr_conn; /*Current connection */
int fsprobe_statsBytes; /*Num bytes in stats block */
int fsprobe_probeOKBytes; /*Num bytes in probeOK block */
int conn_err = 0, code = 0;
int curr_srv;
char *hostNameFound;
int PortToUse;
struct rx_securityClass *secobj;
struct rx_securityClass *CBsecobj;
struct rx_service *rxsrv_afsserver;
char buff2[256] = "";
struct rx_call *rxcall; /*Bogus param */
AFSCBFids *Fids_Array; /*Bogus param */
src/Monitor.xs view on Meta::CPAN
if (code == RX_ADDRINUSE) {
if (scout_debugfd) {
fprintf(scout_debugfd,
"[%s] Callback port %d in use, advancing\n", rn,
PortToUse);
fflush(scout_debugfd);
}
PortToUse++;
}
else {
sprintf(buffer, "[%s] Fatal error in rx_Init()\n", rn);
return (-1);
}
}
} while (code);
if (scout_debugfd) {
fprintf(scout_debugfd, "[%s] Rx initialized on port %d\n", rn,
PortToUse);
fflush(scout_debugfd);
}
src/Monitor.xs view on Meta::CPAN
return (-1);
}
if (scout_debugfd) {
fprintf(scout_debugfd,
"[%s] Probe LWP client security object created\n", rn);
fflush(scout_debugfd);
}
curr_conn = *fsprobe_ConnInfo;
conn_err = 0;
for (curr_srv = 0; curr_srv < a_numServers; curr_srv++) {
/*
* Copy in the socket info for the current server, resolve its
* printable name if possible.
*/
if (scout_debugfd) {
fprintf(scout_debugfd,
"[%s] Copying in the following socket info:\n", rn);
fprintf(scout_debugfd, "[%s] IP addr 0x%lx, port %d\n", rn,
(a_socketArray + curr_srv)->sin_addr.s_addr,
src/Monitor.xs view on Meta::CPAN
curr_conn->rxconn = rx_NewConnection(curr_conn->skt.sin_addr.s_addr, /*Server addr */
curr_conn->skt.sin_port, /*Server port */
1, /*AFS service num */
secobj, /*Security object */
0); /*Number of above */
if (curr_conn->rxconn == (struct rx_connection *) NULL) {
sprintf(buffer,
"[%s] Can't create Rx connection to server %s (%lu)",
rn, curr_conn->hostName, curr_conn->skt.sin_addr.s_addr);
conn_err = 1;
}
if (scout_debugfd) {
fprintf(scout_debugfd, "[%s] New connection at 0x%lx\n",
rn, curr_conn->rxconn);
fflush(scout_debugfd);
}
/*
* Make an Rx connection to the current volume server.
*/
src/Monitor.xs view on Meta::CPAN
}
curr_conn->rxVolconn = rx_NewConnection(curr_conn->skt.sin_addr.s_addr, /*Server addr */
htons(AFSCONF_VOLUMEPORT), /*Volume Server port */
VOLSERVICE_ID, /*AFS service num */
secobj, /*Security object */
0); /*Number of above */
if (curr_conn->rxVolconn == (struct rx_connection *) NULL) {
sprintf(buffer,
"[%s] Can't create Rx connection to volume server %s (%lu)\n",
rn, curr_conn->hostName, curr_conn->skt.sin_addr.s_addr);
conn_err = 1;
}
else {
int i, cnt;
memset(&curr_conn->partList, 0, sizeof(struct partList));
curr_conn->partCnt = 0;
i = my_XListPartitions(curr_conn->rxVolconn, &curr_conn->partList,
&cnt, scout_debugfd);
if (!i) {
curr_conn->partCnt = cnt;
src/Monitor.xs view on Meta::CPAN
fprintf(scout_debugfd, "[%s] Starting up callback listener.\n", rn);
rx_StartServer(0 /*Don't donate yourself to LWP pool */ );
/* start probe */
code = my_fsprobe_LWP(a_numServers, *fsprobe_ConnInfo, fsprobe_Results,
fsprobe_statsBytes, fsprobe_probeOKBytes,
scout_debugfd, RETVAL, buffer);
if (code)
return (code);
if (conn_err)
return (-2);
else
return (0);
} /* my_fsprobe_Init() */
/*
* from src/scout/scout.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
src/Monitor.xs view on Meta::CPAN
void
my_cm_PrintErrInfo(a_opIdx, a_opNames, a_opErrP, RPCERRORS)
int a_opIdx;
char *a_opNames[];
struct afs_stats_RPCErrors *a_opErrP;
HV *RPCERRORS;
{
HV *ERRORS = newHV();
hv_store(ERRORS, "err_Server", 10, newSViv(a_opErrP->err_Server), 0);
hv_store(ERRORS, "err_Network", 11, newSViv(a_opErrP->err_Network), 0);
hv_store(ERRORS, "err_Protection", 14, newSViv(a_opErrP->err_Protection), 0);
hv_store(ERRORS, "err_Volume", 10, newSViv(a_opErrP->err_Volume), 0);
hv_store(ERRORS, "err_VolumeBusies", 16, newSViv(a_opErrP->err_VolumeBusies), 0);
hv_store(ERRORS, "err_Other", 9, newSViv(a_opErrP->err_Other), 0);
hv_store(RPCERRORS, a_opNames[a_opIdx], strlen(a_opNames[a_opIdx]),
newRV_inc((SV *) ERRORS), 0);
}
/*
* from src/xstat/xstat_cm_test.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
src/Monitor.xs view on Meta::CPAN
/* end of xstat_cm_test helper functions */
MODULE = AFS::Monitor PACKAGE = AFS::Monitor PREFIX = afs_
PROTOTYPES: ENABLE
BOOT:
initialize_rxk_error_table();
void
afs_do_xstat_cm_test(args)
HV* args = (HV*) SvRV($arg);
PREINIT:
PPCODE:
{
SV *value;
I32 keylen = 0;
src/Monitor.xs view on Meta::CPAN
BSETCODE(code, buffer);
if (scout_debugfd != (FILE *) NULL) {
fprintf(scout_debugfd, "[%s] Closing debugging file\n", rn);
fclose(scout_debugfd);
}
XSRETURN_UNDEF;
}
code = my_FS_Handler(fsprobe_Results, numservers, fsprobe_ConnInfo,
scout_debugfd, RETVAL, buff2);
if (code) {
sprintf(buffer, "[%s] Handler routine returned error code %d. %s", rn, code, buff2);
BSETCODE(code, buffer);
if (scout_debugfd != (FILE *) NULL) {
fprintf(scout_debugfd, "[%s] Closing debugging file\n", rn);
fclose(scout_debugfd);
}
XSRETURN_UNDEF;
}
if (scout_debugfd != (FILE *) NULL) {
fprintf(scout_debugfd, "[%s] Closing debugging file\n", rn);
src/Monitor.xs view on Meta::CPAN
memset(&usdebug, 0, sizeof(usdebug));
code = VOTE_SDebugOld(tconn, i, (struct ubik_sdebug_old *) ptr);
}
else
code = VOTE_SDebug(tconn, i, &usdebug);
#endif
if (code > 0)
break; /* done */
if (code < 0) {
warn("error code %d from VOTE_SDebug\n", code);
break;
}
/* otherwise print the structure */
USDEBUG = newHV();
inhostAddr.s_addr = htonl(usdebug.addr);
hv_store(USDEBUG, "addr", 4, newSVpv(afs_inet_ntoa(htonl(usdebug.addr)), 0), 0);
ALTADDR = newAV();
src/Monitor.xs view on Meta::CPAN
/* fprintf(STDERR, "it has %d elements.\n", num+1); */
for(i=0; i<=num; i++) {
host = (char *) SvPV(*av_fetch(host_array, i, 0), PL_na);
sprintf(buffer,"cm %s",host);
code = my_parse_hostEntry(buffer, &numFS, &numCM, &lastHostType,
&last_hostEntry, &FSnameList, &CMnameList, buff2);
/* fprintf(STDERR, "got host: %s\n", host); */
if (code) {
sprintf(buffer, "Could not parse cache manager %s. %s", host, buff2);
BSETCODE(180, buffer);
/* 180 is the exit code for this error in the original afsmonitor.c */
XSRETURN_UNDEF;
}
}
} else goto unrecognized;
break;
case 's':
if(strncmp(key, "cmshow", keylen) == 0 && keylen <= 6) {
/* fprintf(STDERR, "flag %s recognized as cmshow\n", key); */
show_array = (AV*) SvRV(value);
num = av_len(show_array);
src/Monitor.xs view on Meta::CPAN
XSRETURN_UNDEF;
}
fclose (outputFD);
}
/* cannot use 'detailed' without 'output' */
if (detailed) {
if (!output_filename) {
sprintf(buffer, "detailed switch can be used only with output switch");
BSETCODE(165, buffer);
/* 165 is the exit code for this error in the original afsmonitor.c */
XSRETURN_UNDEF;
}
}
/* The config option is mutually exclusive with the fshosts,cmhosts options */
if (config_filename) {
if (numFS || numCM) {
sprintf(buffer,"Cannot use config option with fshosts or cmhosts");
BSETCODE(170, buffer);
/* 170 is the exit code for this error in the original afsmonitor.c */
XSRETURN_UNDEF;
}
}
else {
if (!numFS && !numCM) {
sprintf(buffer,"Must specify either config or (fshosts and/or cmhosts) options");
BSETCODE(175, buffer);
/* 175 is the exit code for this error in the original afsmonitor.c */
XSRETURN_UNDEF;
}
}
if (fsthresh_array) {
if(!numFS) {
sprintf(buffer, "Cannot use fsthresh option without specifying fshosts");
BSETCODE(-1, buffer);
XSRETURN_UNDEF;
}
src/Monitor.xs view on Meta::CPAN
temp_host->numThresh += global_fsThreshCount;
temp_host = temp_host->next;
}
}
temp_host = FSnameList;
for (i = 0; i < numFS; i++) {
if (temp_host->numThresh) {
numBytes = temp_host->numThresh * sizeof(struct Threshold);
temp_host->thresh = (struct Threshold *)malloc(numBytes);
if (temp_host->thresh == (struct Threshold *) NULL) {
sprintf(buffer, "Memory Allocation error 1.5");
BSETCODE(25, buffer);
XSRETURN_UNDEF;
}
memset(temp_host->thresh, 0, numBytes);
}
temp_host = temp_host->next;
}
num = av_len(fsthresh_array);
for (i=0; i<=num; i++) {
thresh_host = 0;
src/Monitor.xs view on Meta::CPAN
temp_host->numThresh += global_cmThreshCount;
temp_host = temp_host->next;
}
}
temp_host = CMnameList;
for (i = 0; i < numCM; i++) {
if (temp_host->numThresh) {
numBytes = temp_host->numThresh * sizeof(struct Threshold);
temp_host->thresh = (struct Threshold *)malloc(numBytes);
if (temp_host->thresh == (struct Threshold *) NULL) {
sprintf(buffer, "Memory Allocation error 2.5");
BSETCODE(25, buffer);
XSRETURN_UNDEF;
}
memset(temp_host->thresh, 0, numBytes);
}
temp_host = temp_host->next;
}
num = av_len(cmthresh_array);
for (i=0; i<=num; i++) {
thresh_host = 0;
src/Monitor.xs view on Meta::CPAN
BSETCODE(-1, buffer);
XSRETURN_UNDEF;
}
*collIDP = 2; /* USE A macro for this */
code = my_xstat_fs_Init(my_afsmon_FS_Handler, numFS, FSSktArray, numCollIDs,
collIDP, buff2, output_filename, detailed, FILESERV,
FSnameList, fs_showFlags, fs_showDefault);
if (code) {
sprintf(buffer,"my_xstat_fs_Init() returned error. %s", buff2);
BSETCODE(125, buffer);
XSRETURN_UNDEF;
}
} /* end of process fileserver entries */
/* process cache manager entries */
if (numCM) {
/* Allocate an array of sockets for each fileserver we monitor */
CMsktbytes = numCM * sizeof(struct sockaddr_in);
src/Monitor.xs view on Meta::CPAN
BSETCODE(-1, buffer);
XSRETURN_UNDEF;
}
*collIDP = 2; /* USE A macro for this */
code = my_xstat_cm_Init(my_afsmon_CM_Handler, numCM, CMSktArray, numCollIDs,
collIDP, buff2, output_filename, detailed, CACHEMAN,
CMnameList, cm_showFlags, cm_showDefault);
if (code) {
sprintf(buffer,"my_xstat_cm_Init() returned error. %s", buff2);
BSETCODE(130, buffer);
XSRETURN_UNDEF;
}
} /* end of process fileserver entries */
/* end from afsmon_execute() */
SETCODE(0);
src/Monitor.xs view on Meta::CPAN
struct rx_debugStats tstats;
char *portName = (char *) NULL;
char *hostName = (char *) NULL;
struct rx_debugConn tconn;
short noConns=0;
short showPeers=0;
short showLong=0;
int version_flag=0;
afs_int32 length=64;
char version[64];
char buffer[240]; /* for error messages */
afs_uint32 supportedDebugValues = 0;
afs_uint32 supportedStatValues = 0;
afs_uint32 supportedConnValues = 0;
afs_uint32 supportedPeerValues = 0;
afs_int32 nextconn = 0;
afs_int32 nextpeer = 0;
size = hv_iterinit(args);
/* fprintf(STDERR, "Parsing args now: %d\n", size); */
src/Monitor.xs view on Meta::CPAN
s = socket(AF_INET, SOCK_DGRAM, 0);
taddr.sin_family = AF_INET;
taddr.sin_port = 0;
taddr.sin_addr.s_addr = 0;
#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
taddr.sin_len = sizeof(struct sockaddr_in);
#endif
code = bind(s, (struct sockaddr *) &taddr, sizeof(struct sockaddr_in));
FSSETCODE(code);
if (code) {
perror("bind");
XSRETURN_UNDEF;
}
if (version_flag) /* add version to RETVAL and finish */
{
code = rx_GetServerVersion(s, host, port, length, version);
if (code < 0)
{
sprintf(buffer, "get version call failed with code %d, errno %d",code,errno);
BSETCODE(code, buffer);
XSRETURN_UNDEF;
}
hv_store(RETVAL, "version", 7, newSVpv(version, 0), 0);
goto done;
}
code = rx_GetServerDebug(s, host, port, &tstats, &supportedDebugValues);
if (code < 0) {
src/Monitor.xs view on Meta::CPAN
(tconn.secStats.level != onlyAuth)) continue;
}
}
TCONN = newHV();
hostAddr.s_addr = tconn.host;
hv_store(TCONN, "host", 4, newSVpv(inet_ntoa(hostAddr), 0), 0);
hv_store(TCONN, "port", 4, newSViv(ntohs(tconn.port)), 0);
hv_store(TCONN, "cid", 3, newSViv(tconn.cid), 0);
hv_store(TCONN, "epoch", 5, newSViv(tconn.epoch), 0);
hv_store(TCONN, "error", 5, newSViv(tconn.error), 0);
hv_store(TCONN, "serial", 6, newSViv(tconn.serial), 0);
hv_store(TCONN, "natMTU", 6, newSViv(tconn.natMTU), 0);
hv_store(TCONN, "flags", 5, newSViv(tconn.flags), 0);
hv_store(TCONN, "securityIndex", 13, newSViv(tconn.securityIndex), 0);
hv_store(TCONN, "type", 4, newSViv(tconn.type), 0);
if (withSecStats) {
src/Monitor.xs view on Meta::CPAN
ST(0) = sv_2mortal(newRV_inc((SV*)RETVAL));
SETCODE(0);
XSRETURN(1);
}
void
afs_error_message(code)
int32 code
PPCODE:
{
ST(0) = sv_newmortal();
sv_setpv(ST(0), (char *) error_message(code));
XSRETURN(1);
}
/* this function is generated automatically by constant_gen */
/* You didn't think I would type in this crap did you? */
/* thats what perl is for :-) */
void
constant(name, arg=0)
char * name
int arg
PPCODE:
{
ST(0) = sv_newmortal();
errno = EINVAL;
switch (name[0]) {
case 'A':
switch (name[1]) {
case 'F':
switch (name[2]) {
case 'S':
if (strEQ(name,"AFSCB_MAX_XSTAT_LONGS"))
sv_setiv(ST(0),AFSCB_MAX_XSTAT_LONGS);
else if (strEQ(name,"AFSCB_XSTATSCOLL_CALL_INFO"))
src/Monitor.xs view on Meta::CPAN
default:
ST(0) = ST(1) = &PL_sv_undef;
return;
}
break;
default:
ST(0) = ST(1) = &PL_sv_undef;
return;
}
errno = 0;
XSRETURN(1);
return;
}
src/afsmon-labels.h view on Meta::CPAN
"XStatsVersion_ops_sum",
"XStatsVersion_ops_sqr",
"XStatsVersion_ops_min",
"XStatsVersion_ops_max",
"GetXStats_ops",
"GetXStats_ops_ok",
"GetXStats_ops_sum",
"GetXStats_ops_sqr",
"GetXStats_ops_min",
"GetXStats_ops_max",
"FetchData_srv_err", /* File Server RPC Error Info */
"FetchData_net_err",
"FetchData_prot_err_err",
"FetchData_vol_err",
"FetchData_busy_err",
"FetchData_other_err",
"FetchACL_srv_err",
"FetchACL_net_err",
"FetchACL_prot_err",
"FetchACL_vol_err",
"FetchACL_busy_err",
"FetchACL_other_err",
"FetchStatus_srv_err",
"FetchStatus_net_err",
"FetchStatus_prot_err",
"FetchStatus_vol_err",
"FetchStatus_busy_err",
"FetchStatus_other_err",
"StoreData_srv_err",
"StoreData_net_err",
"StoreData_prot_err",
"StoreData_vol_err",
"StoreData_busy_err",
"StoreData_other_err",
"StoreACL_srv_err",
"StoreACL_net_err",
"StoreACL_prot_err",
"StoreACL_vol_err",
"StoreACL_busy_err",
"StoreACL_other_err",
"StoreStatus_srv_err",
"StoreStatus_net_err",
"StoreStatus_prot_err",
"StoreStatus_vol_err",
"StoreStatus_busy_err",
"StoreStatus_other_err",
"RemoveFile_srv_err",
"RemoveFile_net_err",
"RemoveFile_prot_err",
"RemoveFile_vol_err",
"RemoveFile_busy_err",
"RemoveFile_other_err",
"CreateFile_srv_err",
"CreateFile_net_err",
"CreateFile_prot_err",
"CreateFile_vol_err",
"CreateFile_busy_err",
"CreateFile_other_err",
"Rename_srv_err",
"Rename_net_err",
"Rename_prot_err",
"Rename_vol_err",
"Rename_busy_err",
"Rename_other_err",
"Symlink_srv_err",
"Symlink_net_err",
"Symlink_prot_err",
"Symlink_vol_err",
"Symlink_busy_err",
"Symlink_other_err",
"Link_srv_err",
"Link_net_err",
"Link_prot_err",
"Link_vol_err",
"Link_busy_err",
"Link_other_err",
"MakeDir_srv_err",
"MakeDir_net_err",
"MakeDir_prot_err",
"MakeDir_vol_err",
"MakeDir_busy_err",
"MakeDir_other_err",
"RemoveDir_srv_err",
"RemoveDir_net_err",
"RemoveDir_prot_err",
"RemoveDir_vol_err",
"RemoveDir_busy_err",
"RemoveDir_other_err",
"SetLock_srv_err",
"SetLock_net_err",
"SetLock_prot_err",
"SetLock_vol_err",
"SetLock_busy_err",
"SetLock_other_err",
"ExtendLock_srv_err",
"ExtendLock_net_err",
"ExtendLock_prot_err",
"ExtendLock_vol_err",
"ExtendLock_busy_err",
"ExtendLock_other_err",
"ReleaseLock_srv_err",
"ReleaseLock_net_err",
"ReleaseLock_prot_err",
"ReleaseLock_vol_err",
"ReleaseLock_busy_err",
"ReleaseLock_other_err",
"GetStatistics_srv_err",
"GetStatistics_net_err",
"GetStatistics_prot_err",
"GetStatistics_vol_err",
"GetStatistics_busy_err",
"GetStatistics_other_err",
"GiveUpCallbacks_srv_err",
"GiveUpCallbacks_net_err",
"GiveUpCallbacks_prot_err",
"GiveUpCallbacks_vol_err",
"GiveUpCallbacks_busy_err",
"GiveUpCallbacks_other_err",
"GetVolumeInfo_srv_err",
"GetVolumeInfo_net_err",
"GetVolumeInfo_prot_err",
"GetVolumeInfo_vol_err",
"GetVolumeInfo_busy_err",
"GetVolumeInfo_other_err",
"GetVolumeStatus_srv_err",
"GetVolumeStatus_net_err",
"GetVolumeStatus_prot_err",
"GetVolumeStatus_vol_err",
"GetVolumeStatus_busy_err",
"GetVolumeStatus_other_err",
"SetVolumeStatus_srv_err",
"SetVolumeStatus_net_err",
"SetVolumeStatus_prot_err",
"SetVolumeStatus_vol_err",
"SetVolumeStatus_busy_err",
"SetVolumeStatus_other_err",
"GetRootVolume_srv_err",
"GetRootVolume_net_err",
"GetRootVolume_prot_err",
"GetRootVolume_vol_err",
"GetRootVolume_busy_err",
"GetRootVolume_other_err",
"CheckToken_srv_err",
"CheckToken_net_err",
"CheckToken_prot_err",
"CheckToken_vol_err",
"CheckToken_busy_err",
"CheckToken_other_err",
"GetTime_srv_err",
"GetTime_net_err",
"GetTime_prot_err",
"GetTime_vol_err",
"GetTime_busy_err",
"GetTime_other_err",
"NGetVolumeInfo_srv_err",
"NGetVolumeInfo_net_err",
"NGetVolumeInfo_prot_err",
"NGetVolumeInfo_vol_err",
"NGetVolumeInfo_busy_err",
"NGetVolumeInfo_other_err",
"BulkStatus_srv_err",
"BulkStatus_net_err",
"BulkStatus_prot_err",
"BulkStatus_vol_err",
"BulkStatus_busy_err",
"BulkStatus_other_err",
"XStatsVersion_srv_err",
"XStatsVersion_net_err",
"XStatsVersion_prot_err",
"XStatsVersion_vol_err",
"XStatsVersion_busy_err",
"XStatsVersion_other_err",
"GetXStats_srv_err",
"GetXStats_net_err",
"GetXStats_prot_err",
"GetXStats_vol_err",
"GetXStats_busy_err",
"GetXStats_other_err",
"FetchData_xfers", /* File Server RPC Transfer timings */
"FetchData_xfers_ok",
"FetchData_xfers_sum",
"FetchData_xfers_sqr",
"FetchData_xfers_min",
"FetchData_xfers_max",
"FetchData_Kbytes_sum",
"FetchData_bytes_min",
"FetchData_bytes_max",
"FetchData_bytes_bucket0",
src/ppport.h view on Meta::CPAN
# define PL_curstash curstash
# define PL_copline copline
# define PL_Sv Sv
/* Replace: 0 */
#endif
#ifndef dTHR
# ifdef WIN32
# define dTHR extern int Perl___notused
# else
# define dTHR extern int errno
# endif
#endif
#ifndef boolSV
# define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no)
#endif
#ifndef gv_stashpvn
# define gv_stashpvn(str,len,flags) gv_stashpv(str,flags)
#endif
src/t/Monitor.t view on Meta::CPAN
use strict;
use lib qw(../../inc ../inc ./inc);
use Test::More tests => 11;
BEGIN {
use_ok('AFS::Monitor', qw(error_message constant));
}
# Some very basic tests first:
sub foo { return &AFS::Monitor::RX_CALL_CLEARED }
# test error_message
is(error_message(267274), 'Unknown code pt 10 (267274)', 'Return Code 267274');
# test subroutine returning a constant
is(foo(42,17), 64, 'Sub Foo returns constant (2 args)');
is(foo(42), 64, 'Sub Foo returns constant (1 arg)');
is(foo(), 64, 'Sub Foo returns constant (no args)');
# test constant
is(constant('RX_CONN_DESTROY_ME'), 2, 'Constant RX_CONN_DESTROY_ME');
is(constant('RX_CONN_DESTROY_ME', 2), 2, 'Constant RX_CONN_DESTROY_ME with argument');
isnt(constant('zzz'), 2, 'Unknown Constant zzz');