AFS-Monitor

 view release on metacpan or  search on metacpan

LICENSES/COPYING  view on Meta::CPAN

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  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

78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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

146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
    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

160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
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

249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
                   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

385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
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

496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
  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

279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
         $_,
         $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

284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
=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

1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
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

2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
=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

2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
=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

3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
=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

3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
=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

352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
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

144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
                                           -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

191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
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

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
              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

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
 
#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

96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
   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

711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
*/
 
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

754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
           (*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

1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
      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

1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
   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

1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
   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

1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
   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

1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
/* 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

1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
                             &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

2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
                         *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

2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
*    ("$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

2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
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

2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
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

2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
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

2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
   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

3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
                           &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

3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
*    ("$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

3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
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

3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
HV *NETFID;
HV *CENTRY;
HV *LOCK;
 
for (i = 0; i < 10000; i++) {
   code = RXAFSCB_GetCE(aconn, i, &centry);
   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

3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
HV *NETFID;
HV *CENTRY;
HV *LOCK;
 
for (i = 0; i < 10000; i++) {
    code = RXAFSCB_GetCE(aconn, i, &centry);
    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

3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
HV *NETFID;
HV *CENTRY;
HV *LOCK;
 
for (i = 0; i < 10000; i++) {
    code = RXAFSCB_GetCE64(aconn, i, &centry);
    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

4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
   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

4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
      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

4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
   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

4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
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

4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
}
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

4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
      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

6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
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

7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
 
/* 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

7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
  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

7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
             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

8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
   /* 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

8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
    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

8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
    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

8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
    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

8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
    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

8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
      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

8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
  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

8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
    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

8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
     (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

9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
    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

9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
       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

602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
"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

173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#       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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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');



( run in 0.752 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )