From 0b3531e1cccb7401b06cdf854e95f0eafeae4063 Mon Sep 17 00:00:00 2001 From: "Zane C. Bowers-Hadley" Date: Sat, 9 Mar 2024 16:46:40 -0600 Subject: [PATCH] massively re-work it and clean it up --- snmp/nfs | 822 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 627 insertions(+), 195 deletions(-) diff --git a/snmp/nfs b/snmp/nfs index 87f518458..c6391d0a5 100755 --- a/snmp/nfs +++ b/snmp/nfs @@ -6,7 +6,7 @@ nfs - LibreNMS JSON style SNMP extend for NFS monitoring =head1 VERSION -0.0.1 +0.0.2 =head1 SYNOPSIS @@ -132,198 +132,253 @@ my $data = { mounts => [], mounted_by => [], stats => { - client_rpc_Getattr => undef, - client_rpc_Setattr => undef, - client_rpc_Lookup => undef, - client_rpc_Readlink => undef, - client_rpc_Read => undef, - client_rpc_Write => undef, - client_rpc_Create => undef, - client_rpc_Remove => undef, - client_rpc_Rename => undef, - client_rpc_Link => undef, - client_rpc_Symlink => undef, - client_rpc_Mkdir => undef, - client_rpc_Rmdir => undef, - client_rpc_Readdir => undef, - client_rpc_RdirPlus => undef, - client_rpc_Access => undef, - client_rpc_Mknod => undef, - client_rpc_Fsstat => undef, - client_rpc_FSinfo => undef, - client_rpc_pathConf => undef, - client_rpc_Commit => undef, - client_rpc_SetClId => undef, - client_rpc_SetClIdCf => undef, - client_rpc_Lock => undef, - client_rpc_LockT => undef, - client_rpc_LockU => undef, - client_rpc_Open => undef, - client_rpc_OpenCfr => undef, - client_rpc_OpenDownGr => undef, - client_rpc_Close => undef, - client_rpc_RelLckOwn => undef, - client_rpc_FreeStateID => undef, - client_rpc_PutRootFH => undef, - client_rpc_DelegRet => undef, - client_rpc_GetAcl => undef, - client_rpc_SetAcl => undef, - client_rpc_ExchangeId => undef, - client_rpc_CreateSess => undef, - client_rpc_DestroySess => undef, - client_rpc_DestroyClId => undef, - client_rpc_LayoutGet => undef, - client_rpc_GetDevInfo => undef, - client_rpc_LayoutCommit => undef, - client_rpc_LayoutReturn => undef, - client_rpc_ReclaimCompl => undef, - client_rpc_ReadDataS => undef, - client_rpc_WriteDataS => undef, - client_rpc_CommitDataS => undef, - client_rpc_OpenLayout => undef, - client_rpc_CreateLayout => undef, - client_rpc_BindConnSess => undef, - client_rpc_LookupOpen => undef, - client_rpc_IOAdvise => undef, - client_rpc_Allocate => undef, - client_rpc_Copy => undef, - client_rpc_Seek => undef, - client_rpc_SeekDataS => undef, - client_rpc_GetExtattr => undef, - client_rpc_SetExtattr => undef, - client_rpc_RmExtattr => undef, - client_rpc_ListExtattr => undef, - client_rpc_Deallocate => undef, - client_rpc_LayoutError => undef, - client_OpenOwner => undef, - client_Opens => undef, - client_LockOwner => undef, - client_Locks => undef, - client_Delegs => undef, - client_LocalOwn => undef, - client_LocalOpen => undef, - client_LocalLown => undef, - client_LocalLock => undef, - client_Layouts => undef, - client_rpc_info_TimedOut => undef, - client_rpc_info_Invalid => undef, - client_rpc_info_X_Replies => undef, - client_rpc_info_Retries => undef, - client_rpc_info_Requests => undef, - client_cache_Attr_Hits => undef, - client_cache_Attr_Misses => undef, - client_cache_Lkup_Hits => undef, - client_cache_Lkup_Misses => undef, - client_cache_BioR_Hits => undef, - client_cache_BioR_Misses => undef, - client_cache_BioW_Hits => undef, - client_cache_BioW_Misses => undef, - client_cache_BioRL_Hits => undef, - client_cache_BioRL_Misses => undef, - client_cache_BioD_Hits => undef, - client_cache_BioD_Misses => undef, - client_cache_DirE_Hits => undef, - client_cache_DirE_Misses => undef, - server_rpc_Getattr => undef, - server_rpc_Setattr => undef, - server_rpc_Lookup => undef, - server_rpc_Readlink => undef, - server_rpc_Read => undef, - server_rpc_Write => undef, - server_rpc_Create => undef, - server_rpc_Remove => undef, - server_rpc_Rename => undef, - server_rpc_Link => undef, - server_rpc_Symlink => undef, - server_rpc_Mkdir => undef, - server_rpc_Rmdir => undef, - server_rpc_Readdir => undef, - server_rpc_RdirPlus => undef, - server_rpc_Access => undef, - server_rpc_Mknod => undef, - server_rpc_Fsstat => undef, - server_rpc_FSinfo => undef, - server_rpc_pathConf => undef, - server_rpc_Commit => undef, - server_rpc_LookupP => undef, - server_rpc_SetClId => undef, - server_rpc_SetClIdCf => undef, - server_rpc_Open => undef, - server_rpc_OpenAttr => undef, - server_rpc_OpenDwnGr => undef, - server_rpc_OpenCfrm => undef, - server_rpc_DelePurge => undef, - server_rpc_DelRet => undef, - server_rpc_GetFH => undef, - server_rpc_Lock => undef, - server_rpc_LockT => undef, - server_rpc_LockU => undef, - server_rpc_Close => undef, - server_rpc_Verify => undef, - server_rpc_NVerify => undef, - server_rpc_PutFH => undef, - server_rpc_PutPubFH => undef, - server_rpc_PutRootFH => undef, - server_rpc_Renew => undef, - server_rpc_RestoreFH => undef, - server_rpc_SaveFH => undef, - server_rpc_Secinfo => undef, - server_rpc_RelLockOwn => undef, - server_rpc_V4Create => undef, - server_rpc_BackChannelCt => undef, - server_rpc_BindConnToSes => undef, - server_rpc_ExchangeID => undef, - server_rpc_CreateSess => undef, - server_rpc_DestroySess => undef, - server_rpc_FreeStateID => undef, - server_rpc_GetDirDeleg => undef, - server_rpc_GetDevInfo => undef, - server_rpc_GetDevList => undef, - server_rpc_layoutCommit => undef, - server_rpc_LayoutGet => undef, - server_rpc_LayoutReturn => undef, - server_rpc_GetDirDeleg => undef, - server_rpc_GetDevInfo => undef, - server_rpc_GetDevList => undef, - server_rpc_layoutCommit => undef, - server_rpc_LayoutGet => undef, - server_rpc_LayoutReturn => undef, - server_rpc_SecInfNoName => undef, - server_rpc_Sequence => undef, - server_rpc_SetSSV => undef, - server_rpc_TestStateID => undef, - server_rpc_WantDeleg => undef, - server_rpc_DestroyClId => undef, - server_rpc_ReclaimCompl => undef, - server_rpc_Allocate => undef, - server_rpc_Copy => undef, - server_rpc_CopyNotify => undef, - server_rpc_Deallocate => undef, - server_rpc_IOAdvise => undef, - server_rpc_LayoutError => undef, - server_rpc_LayoutStats => undef, - server_rpc_OffloadCncl => undef, - server_rpc_OffloadStat => undef, - server_rpc_ReadPlus => undef, - server_rpc_Seek => undef, - server_rpc_WriteSame => undef, - server_rpc_Clone => undef, - server_rpc_GetExtattr => undef, - server_rpc_SetExtattr => undef, - server_rpc_ListExtattr => undef, - server_rpc_RmExtattr => undef, - server_Clients => undef, - server_OpenOwner => undef, - server_Opens => undef, - server_LockOwner => undef, - server_Locks => undef, - server_Delegs => undef, - server_Layouts => undef, - server_cache_Inprog => undef, - server_cache_NonIdem => undef, - server_cache_Misses => undef, - server_cache_CacheSize => undef, - server_cache_TCPPeak => undef, + client_rpc_null => 0, + client_rpc_root => 0, + client_rpc_confirm => 0, + client_rpc_server_caps => 0, + client_rpc_fs_locations => 0, + client_rpc_secinfo => 0, + client_rpc_fsid_present => 0, + client_rpc_sequence => 0, + client_rpc_get_lease_time => 0, + client_rpc_test_stateid => 0, + client_rpc_secinfo_no => 0, + client_rpc_getdevicelist => 0, + client_rpc_layoutstats => 0, + client_rpc_wrcache => 0, + client_rpc_Getattr => 0, + client_rpc_Setattr => 0, + client_rpc_Lookup => 0, + client_rpc_Readlink => 0, + client_rpc_Read => 0, + client_rpc_Write => 0, + client_rpc_Create => 0, + client_rpc_Remove => 0, + client_rpc_Rename => 0, + client_rpc_Link => 0, + client_rpc_Symlink => 0, + client_rpc_Mkdir => 0, + client_rpc_Rmdir => 0, + client_rpc_Readdir => 0, + client_rpc_RdirPlus => 0, + client_rpc_Access => 0, + client_rpc_Mknod => 0, + client_rpc_Fsstat => 0, + client_rpc_FSinfo => 0, + client_rpc_pathConf => 0, + client_rpc_Commit => 0, + client_rpc_SetClId => 0, + client_rpc_SetClIdCf => 0, + client_rpc_Lock => 0, + client_rpc_LockT => 0, + client_rpc_LockU => 0, + client_rpc_Open => 0, + client_rpc_OpenCfr => 0, + client_rpc_OpenDownGr => 0, + client_rpc_Close => 0, + client_rpc_RelLckOwn => 0, + client_rpc_FreeStateID => 0, + client_rpc_PutRootFH => 0, + client_rpc_DelegRet => 0, + client_rpc_GetAcl => 0, + client_rpc_SetAcl => 0, + client_rpc_ExchangeId => 0, + client_rpc_CreateSess => 0, + client_rpc_DestroySess => 0, + client_rpc_DestroyClId => 0, + client_rpc_LayoutGet => 0, + client_rpc_GetDevInfo => 0, + client_rpc_LayoutCommit => 0, + client_rpc_LayoutReturn => 0, + client_rpc_ReclaimCompl => 0, + client_rpc_ReadDataS => 0, + client_rpc_WriteDataS => 0, + client_rpc_CommitDataS => 0, + client_rpc_OpenLayout => 0, + client_rpc_CreateLayout => 0, + client_rpc_BindConnSess => 0, + client_rpc_LookupOpen => 0, + client_rpc_IOAdvise => 0, + client_rpc_Allocate => 0, + client_rpc_Copy => 0, + client_rpc_Seek => 0, + client_rpc_SeekDataS => 0, + client_rpc_GetExtattr => 0, + client_rpc_SetExtattr => 0, + client_rpc_RmExtattr => 0, + client_rpc_ListExtattr => 0, + client_rpc_Deallocate => 0, + client_rpc_LayoutError => 0, + client_OpenOwner => 0, + client_Opens => 0, + client_LockOwner => 0, + client_Locks => 0, + client_Delegs => 0, + client_LocalOwn => 0, + client_LocalOpen => 0, + client_LocalLown => 0, + client_LocalLock => 0, + client_Layouts => 0, + client_rpc_info_TimedOut => 0, + client_rpc_info_Invalid => 0, + client_rpc_info_X_Replies => 0, + client_rpc_info_Retries => 0, + client_rpc_info_Requests => 0, + client_rpc_info_authrefrsh => 0, + client_cache_Attr_Hits => 0, + client_cache_Attr_Misses => 0, + client_cache_Lkup_Hits => 0, + client_cache_Lkup_Misses => 0, + client_cache_BioR_Hits => 0, + client_cache_BioR_Misses => 0, + client_cache_BioW_Hits => 0, + client_cache_BioW_Misses => 0, + client_cache_BioRL_Hits => 0, + client_cache_BioRL_Misses => 0, + client_cache_BioD_Hits => 0, + client_cache_BioD_Misses => 0, + client_cache_DirE_Hits => 0, + client_cache_DirE_Misses => 0, + client_network_packets => 0, + client_network_udp => 0, + client_network_tcp => 0, + client_network_tcpconn => 0, + server_rpc_Getattr => 0, + server_rpc_Setattr => 0, + server_rpc_Lookup => 0, + server_rpc_Readlink => 0, + server_rpc_Read => 0, + server_rpc_Write => 0, + server_rpc_Create => 0, + server_rpc_Remove => 0, + server_rpc_Rename => 0, + server_rpc_Link => 0, + server_rpc_Symlink => 0, + server_rpc_Mkdir => 0, + server_rpc_Rmdir => 0, + server_rpc_Readdir => 0, + server_rpc_RdirPlus => 0, + server_rpc_Access => 0, + server_rpc_Mknod => 0, + server_rpc_Fsstat => 0, + server_rpc_FSinfo => 0, + server_rpc_pathConf => 0, + server_rpc_Commit => 0, + server_rpc_LookupP => 0, + server_rpc_SetClId => 0, + server_rpc_SetClIdCf => 0, + server_rpc_Open => 0, + server_rpc_OpenAttr => 0, + server_rpc_OpenDwnGr => 0, + server_rpc_OpenCfrm => 0, + server_rpc_DelePurge => 0, + server_rpc_DelRet => 0, + server_rpc_GetFH => 0, + server_rpc_Lock => 0, + server_rpc_LockT => 0, + server_rpc_LockU => 0, + server_rpc_Close => 0, + server_rpc_Verify => 0, + server_rpc_NVerify => 0, + server_rpc_PutFH => 0, + server_rpc_PutPubFH => 0, + server_rpc_PutRootFH => 0, + server_rpc_Renew => 0, + server_rpc_RestoreFH => 0, + server_rpc_SaveFH => 0, + server_rpc_Secinfo => 0, + server_rpc_RelLockOwn => 0, + server_rpc_V4Create => 0, + server_rpc_BackChannelCt => 0, + server_rpc_BindConnToSes => 0, + server_rpc_ExchangeID => 0, + server_rpc_CreateSess => 0, + server_rpc_DestroySess => 0, + server_rpc_FreeStateID => 0, + server_rpc_GetDirDeleg => 0, + server_rpc_GetDevInfo => 0, + server_rpc_GetDevList => 0, + server_rpc_layoutCommit => 0, + server_rpc_LayoutGet => 0, + server_rpc_LayoutReturn => 0, + server_rpc_GetDirDeleg => 0, + server_rpc_GetDevInfo => 0, + server_rpc_GetDevList => 0, + server_rpc_layoutCommit => 0, + server_rpc_LayoutGet => 0, + server_rpc_LayoutReturn => 0, + server_rpc_SecInfNoName => 0, + server_rpc_Sequence => 0, + server_rpc_SetSSV => 0, + server_rpc_TestStateID => 0, + server_rpc_WantDeleg => 0, + server_rpc_DestroyClId => 0, + server_rpc_ReclaimCompl => 0, + server_rpc_Allocate => 0, + server_rpc_Copy => 0, + server_rpc_CopyNotify => 0, + server_rpc_Deallocate => 0, + server_rpc_IOAdvise => 0, + server_rpc_LayoutError => 0, + server_rpc_LayoutStats => 0, + server_rpc_OffloadCncl => 0, + server_rpc_OffloadStat => 0, + server_rpc_ReadPlus => 0, + server_rpc_Seek => 0, + server_rpc_WriteSame => 0, + server_rpc_Clone => 0, + server_rpc_GetExtattr => 0, + server_rpc_SetExtattr => 0, + server_rpc_ListExtattr => 0, + server_rpc_RmExtattr => 0, + server_Clients => 0, + server_OpenOwner => 0, + server_Opens => 0, + server_LockOwner => 0, + server_Locks => 0, + server_Delegs => 0, + server_Layouts => 0, + server_network_packets => 0, + server_network_udp => 0, + server_network_tcp => 0, + server_network_tcpconn => 0, + server_rpcStats_calls => 0, + server_rpcStats_badcalls => 0, + server_rpcStats_badfmt => 0, + server_rpcStats_badauth => 0, + server_rpcStats_badclnt => 0, + server_cache_Inprog => 0, + server_cache_NonIdem => 0, + server_cache_Misses => 0, + server_cache_CacheSize => 0, + server_cache_TCPPeak => 0, + server_cache_hits => 0, + server_cache_nocache => 0, + server_io_read => 0, + server_io_write => 0, + server_RAcache_0 => 0, + server_RAcache_1 => 0, + server_RAcache_2 => 0, + server_RAcache_3 => 0, + server_RAcache_4 => 0, + server_RAcache_5 => 0, + server_RAcache_6 => 0, + server_RAcache_7 => 0, + server_RAcache_8 => 0, + server_RAcache_9 => 0, + server_RAcache_notfound => 0, + server_FHcache_lookup => 0, + server_FHcache_anon => 0, + server_FHcache_ncachedir => 0, + server_FHcache_ncachenondir => 0, + server_FHcache_stale => 0, + server_rpc_null => 0, + server_rpc_root => 0, + server_rpc_wrcache => 0, + server_rpc_compound => 0, + server_rpc_op0_unused => 0, + server_rpc_op1_unused => 0, + server_rpc_op2_future => 0, } }; @@ -611,14 +666,391 @@ if ( $^O eq 'linux' ) { my @output_split = split( /\n/, $output_raw ); my $previous_line = ''; my $mode = ''; + foreach my $line (@output_split) { if ( $line =~ /^[Cc]lient/ ) { $mode = 'client'; } elsif ( $line =~ /^[Ss]erver/ ) { $mode = 'server'; } - if ( $previous_line =~ /calls\ +badcalls\ +badfmt\ +badauth\ +badclnt/ && $mode eq 'server' ) { - + if ( $previous_line =~ /packets\ +udp\ +tcp\ +tcpconn/ && $mode eq 'server' ) { + ( + $data->{stats}{server_network_packets}, $data->{stats}{server_network_udp}, + $data->{stats}{server_network_tcp}, $data->{stats}{server_network_tcpconn}, + ) = split( /[\t\ ]+/, $line ); + } elsif ( $previous_line =~ /calls\ +badcalls\ +badfmt\ +badauth\ +badclnt/ && $mode eq 'server' ) { + ( + $data->{stats}{server_rpcStats_calls}, $data->{stats}{server_rpcStats_badcalls}, + $data->{stats}{server_rpcStats_badfmt}, $data->{stats}{server_rpcStats_badauth}, + $data->{stats}{server_rpcStats_badclnt}, + ) = split( /[\t\ ]+/, $line ); + } elsif ( $previous_line =~ /hits\ +misses\ +nocache/ && $mode eq 'server' ) { + ( + $data->{stats}{server_cache_hits}, + $data->{stats}{server_cache_Misses}, + $data->{stats}{server_cache_nocache}, + ) = split( /[\t\ ]+/, $line ); + } elsif ( $previous_line =~ /read\ +write/ && $mode eq 'server' ) { + ( $data->{stats}{server_io_read}, $data->{stats}{server_io_write}, ) = split( /[\t\ ]+/, $line ); + } elsif ( $previous_line + =~ /size\ +0\-10\%\ +10\-20\%\ +20\-3\0%\ +30\-40\%\ +40\-50\%\ +50\-60\%\ +60\-70\%\ +70\-80\%\ +80\-90\%\ +90\-100\%\ +notfound/ + && $mode eq 'server' ) + { + ( + $data->{stats}{server_RAcache_0}, $data->{stats}{server_RAcache_1}, + $data->{stats}{server_RAcache_2}, $data->{stats}{server_RAcache_3}, + $data->{stats}{server_RAcache_4}, $data->{stats}{server_RAcache_5}, + $data->{stats}{server_RAcache_6}, $data->{stats}{server_RAcache_7}, + $data->{stats}{server_RAcache_8}, $data->{stats}{server_RAcache_9}, + $data->{stats}{server_RAcache_notfound} + ) = split( /[\t\ ]+/, $line ); + } elsif ( $previous_line =~ /lookup\ +anon\ +ncachedir\ +ncachenondir\ +stale/ && $mode eq 'server' ) { + ( + $data->{stats}{server_FHcache_lookup}, $data->{stats}{server_FHcache_anon}, + $data->{stats}{server_FHcache_ncachedir}, $data->{stats}{server_FHcache_ncachenondir}, + $data->{stats}{server_FHcache_stale}, + ) = split( /[\t\ ]+/, $line ); + } elsif ( $previous_line =~ /null\ +getattr\ +setattr\ +root\ +lookup/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_null} += $split[0]; + $data->{stats}{server_rpc_Getattr} += $split[1]; + $data->{stats}{server_rpc_Setattr} += $split[2]; + $data->{stats}{server_rpc_root} += $split[3]; + $data->{stats}{server_rpc_Lookup} += $split[4]; + } elsif ( $previous_line =~ /readlink\ +read\ +wrcache\ +write\ +create/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_Readlink} += $split[0]; + $data->{stats}{server_rpc_Read} += $split[1]; + $data->{stats}{server_rpc_wrcache} += $split[2]; + $data->{stats}{server_rpc_Write} += $split[3]; + $data->{stats}{server_rpc_Create} += $split[4]; + } elsif ( $previous_line =~ /remove\ +rename\ +link\ +symlink\ +mkdir/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_Remove} += $split[0]; + $data->{stats}{server_rpc_Rename} += $split[1]; + $data->{stats}{server_rpc_Link} += $split[2]; + $data->{stats}{server_rpc_Symlink} += $split[3]; + $data->{stats}{server_rpc_Mkdir} += $split[4]; + } elsif ( $previous_line =~ /rmdir\ +readdir\ +fsstat/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_Rmdir} += $split[0]; + $data->{stats}{server_rpc_Readdir} += $split[1]; + $data->{stats}{server_rpc_Fsstat} += $split[2]; + } elsif ( $previous_line =~ /null\ +getattr\ +setattr\ +lookup\ +access/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_null} += $split[0]; + $data->{stats}{server_rpc_Getattr} += $split[1]; + $data->{stats}{server_rpc_Setattr} += $split[2]; + $data->{stats}{server_rpc_Lookup} += $split[3]; + $data->{stats}{server_rpc_Access} += $split[4]; + } elsif ( $previous_line =~ /readlink\ +read\ +write\ +create\ +mkdir/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_Readlink} += $split[0]; + $data->{stats}{server_rpc_Read} += $split[1]; + $data->{stats}{server_rpc_Write} += $split[2]; + $data->{stats}{server_rpc_Create} += $split[3]; + $data->{stats}{server_rpc_Mkdir} += $split[4]; + } elsif ( $previous_line =~ /symlink\ +mknod\ +remove\ +rmdir\ +rename/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_Symlink} += $split[0]; + $data->{stats}{server_rpc_Mknod} += $split[1]; + $data->{stats}{server_rpc_Remove} += $split[2]; + $data->{stats}{server_rpc_Rmdir} += $split[3]; + $data->{stats}{server_rpc_Rename} += $split[4]; + } elsif ( $previous_line =~ /link\ +readdir\ +readdirplus\ +fsstat\ +fsinfo/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_Link} += $split[0]; + $data->{stats}{server_rpc_Readdir} += $split[1]; + $data->{stats}{server_rpc_ReadPlus} += $split[2]; + $data->{stats}{server_rpc_Fsstat} += $split[3]; + $data->{stats}{server_rpc_FSinfo} += $split[4]; + } elsif ( $previous_line =~ /pathconf\ +commit/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_pathConf} += $split[0]; + $data->{stats}{server_rpc_Commit} += $split[1]; + } elsif ( $previous_line =~ /null\ +compound/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_null} += $split[0]; + $data->{stats}{server_rpc_compound} += $split[1]; + } elsif ( $previous_line =~ /op0\-unused\ +op1\-unused\ +op2\-future\ +access\ +close/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_op0_unused} += $split[0]; + $data->{stats}{server_rpc_op1_unused} += $split[1]; + $data->{stats}{server_rpc_op2_future} += $split[2]; + $data->{stats}{server_rpc_Access} += $split[3]; + $data->{stats}{server_rpc_Close} += $split[4]; + } elsif ( $previous_line =~ /commit\ +create\ +delegpurge\ +delegreturn\ +getattr/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_Commit} += $split[0]; + $data->{stats}{server_rpc_Create} += $split[1]; + $data->{stats}{server_rpc_DelePurge} = $split[2]; + $data->{stats}{server_rpc_DelRet} = $split[3]; + $data->{stats}{server_rpc_Getattr} += $split[4]; + } elsif ( $previous_line =~ /getfh\ +link\ +lock\ +lockt\ +locku/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_GetFH} += $split[0]; + $data->{stats}{server_rpc_Link} += $split[1]; + $data->{stats}{server_rpc_Lock} += $split[2]; + $data->{stats}{server_rpc_LockT} += $split[3]; + $data->{stats}{server_rpc_LockU} += $split[4]; + } elsif ( $previous_line =~ /lookup\ +lookup_root\ +nverify\ +open\ +openattr/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_Lookup} += $split[0]; + $data->{stats}{server_rpc_LookupP} += $split[1]; + $data->{stats}{server_rpc_NVerify} += $split[2]; + $data->{stats}{server_rpc_Open} += $split[3]; + $data->{stats}{server_rpc_OpeAttr} += $split[4]; + } elsif ( $previous_line =~ /open_conf\ +open_dgrd\ +putfh\ +putpubfh\ +putrootfh/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_OpenCfrm} += $split[0]; + $data->{stats}{server_rpc_OpenDwnGr} += $split[1]; + $data->{stats}{server_rpc_PutFH} += $split[2]; + $data->{stats}{server_rpc_PutPubFH} += $split[3]; + $data->{stats}{server_rpc_PutRootFH} += $split[4]; + } elsif ( $previous_line =~ /read\ +readdir\ +readlink\ +remove\ +rename/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_Read} += $split[0]; + $data->{stats}{server_rpc_Readdir} += $split[1]; + $data->{stats}{server_rpc_Readlink} += $split[2]; + $data->{stats}{server_rpc_Remove} += $split[3]; + $data->{stats}{server_rpc_Rename} += $split[4]; + } elsif ( $previous_line =~ /renew\ +restorefh\ +savefh\ +secinfo\ +setattr/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_Renew} += $split[0]; + $data->{stats}{server_rpc_RestoreFH} += $split[1]; + $data->{stats}{server_rpc_SaveFH} += $split[2]; + $data->{stats}{server_rpc_Secinfo} += $split[3]; + $data->{stats}{server_rpc_Setattr} += $split[4]; + } elsif ( $previous_line =~ /setcltid\ +setcltidconf\ +verify\ +write\ +rellockowner/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_SetClId} += $split[0]; + $data->{stats}{server_rpc_SetClIdCf} += $split[1]; + $data->{stats}{server_rpc_Verify} += $split[2]; + $data->{stats}{server_rpc_Write} += $split[3]; + $data->{stats}{server_rpc_RelLockOwn} += $split[4]; + } elsif ( $previous_line =~ /bc_ctl\ +bind_conn\ +exchange_id\ +create_ses\ +destroy_ses/ && $mode eq 'server' ) + { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_BackChannelCt} += $split[0]; + $data->{stats}{server_rpc_BindConnToSes} += $split[1]; + $data->{stats}{server_rpc_ExchangeID} += $split[2]; + $data->{stats}{server_rpc_CreateSess} += $split[3]; + $data->{stats}{server_rpc_DestroySess} += $split[4]; + } elsif ( $previous_line =~ /bc_ctl\ +bind_conn\ +exchange_id\ +create_ses\ +destroy_ses/ && $mode eq 'server' ) + { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_BackChannelCt} += $split[0]; + $data->{stats}{server_rpc_BindConnToSes} += $split[1]; + $data->{stats}{server_rpc_ExchangeID} += $split[2]; + $data->{stats}{server_rpc_CreateSess} += $split[3]; + $data->{stats}{server_rpc_DestroySess} += $split[4]; + } elsif ( $previous_line =~ /free_stateid\ +getdirdeleg\ +getdevinfo\ +getdevlist\ +layoutcommit/ + && $mode eq 'server' ) + { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_FreeStateID} += $split[0]; + $data->{stats}{server_rpc_GetDirDeleg} += $split[1]; + $data->{stats}{server_rpc_GetDevInfo} += $split[2]; + $data->{stats}{server_rpc_GetDevList} += $split[3]; + $data->{stats}{server_rpc_layoutCommit} += $split[4]; + } elsif ( $previous_line =~ /layoutget\ +layoutreturn\ +secinfononam\ +sequence\ +set_ssv/ + && $mode eq 'server' ) + { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_LayoutGet} += $split[0]; + $data->{stats}{server_rpc_LayoutReturn} += $split[1]; + $data->{stats}{server_rpc_SecInfNoName} += $split[2]; + $data->{stats}{server_rpc_Sequence} += $split[3]; + $data->{stats}{server_rpc_SetSSV} += $split[4]; + } elsif ( $previous_line =~ /test_stateid\ +want_deleg\ +destroy_clid\ +reclaim_comp\ +allocate/ + && $mode eq 'server' ) + { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_TestStateID} += $split[0]; + $data->{stats}{server_rpc_WantDeleg} += $split[1]; + $data->{stats}{server_rpc_DestroyClId} += $split[2]; + $data->{stats}{server_rpc_ReclaimCompl} += $split[3]; + $data->{stats}{server_rpc_Allocate} += $split[4]; + } elsif ( $previous_line =~ /copy\ +copy_notify\ +deallocate\ +ioadvise\ +layouterror/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_Copy} += $split[0]; + $data->{stats}{server_rpc_CopyNotify} += $split[1]; + $data->{stats}{server_rpc_Deallocate} += $split[2]; + $data->{stats}{server_rpc_IOAdvise} += $split[3]; + $data->{stats}{server_rpc_LayoutError} += $split[4]; + } elsif ( $previous_line =~ /layoutstats\ +offloadcancel\ +offloadstatus\ +readplus\ +seek/ + && $mode eq 'server' ) + { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_LayoutStats} += $split[0]; + $data->{stats}{server_rpc_OffloadCncl} += $split[1]; + $data->{stats}{server_rpc_OffloadStat} += $split[2]; + $data->{stats}{server_rpc_ReadPlus} += $split[3]; + $data->{stats}{server_rpc_Seek} += $split[4]; + } elsif ( $previous_line =~ /write_same/ && $mode eq 'server' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{server_rpc_WriteSame} += $split[0]; + } elsif ( $previous_line =~ /packets\ +udp\ +tcp\ +tcpconn/ && $mode eq 'client' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_network_packets} += $split[0]; + $data->{stats}{client_network_udp} += $split[1]; + $data->{stats}{client_network_tcp} += $split[2]; + $data->{stats}{client_network_tcpconn} += $split[3]; + } elsif ( $previous_line =~ /calls\ +retrans\ +authrefrsh/ && $mode eq 'client' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_info_calls} += $split[0]; + $data->{stats}{client_rpc_info_Retries} += $split[1]; + $data->{stats}{client_rpc_info_authrefrsh} += $split[2]; + } elsif ( $previous_line =~ /null\ +getattr\ +setattr\ +root\ +lookup/ && $mode eq 'client' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_null} += $split[0]; + $data->{stats}{client_rpc_Getattr} += $split[1]; + $data->{stats}{client_rpc_Setattr} += $split[2]; + $data->{stats}{client_rpc_root} += $split[3]; + $data->{stats}{client_rpc_Lookup} += $split[4]; + } elsif ( $previous_line =~ /readlink\ +read\ +wrcache\ +write\ +create/ && $mode eq 'client' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_Readlink} += $split[0]; + $data->{stats}{client_rpc_Read} += $split[1]; + $data->{stats}{client_rpc_wrcache} += $split[2]; + $data->{stats}{client_rpc_Write} += $split[3]; + $data->{stats}{client_rpc_Create} += $split[4]; + } elsif ( $previous_line =~ /remove\ +rename\ +link\ +symlink\ +mkdir/ && $mode eq 'client' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_Remove} += $split[0]; + $data->{stats}{client_rpc_Rename} += $split[1]; + $data->{stats}{client_rpc_Link} += $split[2]; + $data->{stats}{client_rpc_Symlink} += $split[3]; + $data->{stats}{client_rpc_Mkdir} += $split[4]; + } elsif ( $previous_line =~ /rmdir\ +readdir\ +fsstat/ && $mode eq 'client' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_Rmdir} += $split[0]; + $data->{stats}{client_rpc_Readdir} += $split[1]; + $data->{stats}{client_rpc_Fsstat} += $split[2]; + } elsif ( $previous_line =~ /null\ +getattr\ +setattr\ +lookup\ +access/ && $mode eq 'client' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_null} += $split[0]; + $data->{stats}{client_rpc_Getattr} += $split[1]; + $data->{stats}{client_rpc_Setattr} += $split[2]; + $data->{stats}{client_rpc_Lookup} += $split[3]; + $data->{stats}{client_rpc_Access} += $split[4]; + } elsif ( $previous_line =~ /readlink\ +read\ +write\ +create\ +mkdir/ && $mode eq 'client' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_Readlink} += $split[0]; + $data->{stats}{client_rpc_Read} += $split[1]; + $data->{stats}{client_rpc_Write} += $split[2]; + $data->{stats}{client_rpc_Create} += $split[3]; + $data->{stats}{client_rpc_Mkdir} += $split[4]; + } elsif ( $previous_line =~ /symlink\ +mknod\ +remove\ +rmdir\ +rename/ && $mode eq 'client' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_Symlink} += $split[0]; + $data->{stats}{client_rpc_Mknod} += $split[1]; + $data->{stats}{client_rpc_Remove} += $split[2]; + $data->{stats}{client_rpc_Rmdir} += $split[3]; + $data->{stats}{client_rpc_Rename} += $split[4]; + } elsif ( $previous_line =~ /link\ +readdir\ +readdirplus\ +fsstat\ +fsinfo/ && $mode eq 'client' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_Link} += $split[0]; + $data->{stats}{client_rpc_Readdir} += $split[1]; + $data->{stats}{client_rpc_Readdir} += $split[2]; + $data->{stats}{client_rpc_Fsstat} += $split[3]; + $data->{stats}{client_rpc_FSinfo} += $split[4]; + } elsif ( $previous_line =~ /pathconf\ +commit/ && $mode eq 'client' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_pathConf} += $split[0]; + $data->{stats}{client_rpc_Commit} += $split[1]; + } elsif ( $previous_line =~ /null\ +read\ +write\ +commit\ +open/ && $mode eq 'client' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_null} += $split[0]; + $data->{stats}{client_rpc_Read} += $split[1]; + $data->{stats}{client_rpc_Write} += $split[2]; + $data->{stats}{client_rpc_Commit} += $split[3]; + $data->{stats}{client_rpc_Open} += $split[4]; + } elsif ( $previous_line =~ /open_conf\ +open_noat\ +open_dgrd\ +close\ +setattr/ && $mode eq 'client' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_OpenCfr} += $split[0]; + $data->{stats}{client_rpc_OpenLayout} += $split[1]; + $data->{stats}{client_rpc_OpenDownGr} += $split[2]; + $data->{stats}{client_rpc_Close} += $split[3]; + $data->{stats}{client_rpc_Setattr} += $split[4]; + } elsif ( $previous_line =~ /fsinfo\ +renew\ +setclntid\ +confirm\ +lock/ && $mode eq 'client' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_FSinfo} += $split[0]; + $data->{stats}{client_rpc_Rename} += $split[1]; + $data->{stats}{client_rpc_SetClId} += $split[2]; + $data->{stats}{client_rpc_confirm} += $split[3]; + $data->{stats}{client_rpc_Lock} += $split[4]; + } elsif ( $previous_line =~ /lockt\ +locku\ +access\ +getattr\ +lookup/ && $mode eq 'client' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_LockT} += $split[0]; + $data->{stats}{client_rpc_LockU} += $split[1]; + $data->{stats}{client_rpc_Access} += $split[2]; + $data->{stats}{client_rpc_Getattr} += $split[3]; + $data->{stats}{client_rpc_Lookup} += $split[4]; + } elsif ( $previous_line =~ /lookup_root\ +remove\ +rename\ +link\ +symlink/ && $mode eq 'client' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_LookupOpen} += $split[0]; + $data->{stats}{client_rpc_Remove} += $split[1]; + $data->{stats}{client_rpc_Rename} += $split[2]; + $data->{stats}{client_rpc_Link} += $split[3]; + $data->{stats}{client_rpc_Symlink} += $split[4]; + } elsif ( $previous_line =~ /create\ +pathconf\ +statfs\ +readlink\ +readdir/ && $mode eq 'client' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_Create} += $split[0]; + $data->{stats}{client_rpc_pathConf} += $split[1]; + $data->{stats}{client_rpc_Fsstat} += $split[2]; + $data->{stats}{client_rpc_Readlink} += $split[3]; + $data->{stats}{client_rpc_Readdir} += $split[4]; + } elsif ( $previous_line =~ /server_caps\ +delegreturn\ +getacl\ +setacl\ +fs_locations/ && $mode eq 'client' ) + { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_server_caps} += $split[0]; + $data->{stats}{client_rpc_DelegRet} += $split[1]; + $data->{stats}{client_rpc_Getattr} += $split[2]; + $data->{stats}{client_rpc_SetAcl} += $split[3]; + $data->{stats}{client_rpc_fs_locations} += $split[4]; + } elsif ( $previous_line =~ /rel_lkowner\ +secinfo\ +fsid_present\ +exchange_id\ +create_session/ + && $mode eq 'client' ) + { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_RelLckOwn} += $split[0]; + $data->{stats}{client_rpc_secinfo} += $split[1]; + $data->{stats}{client_rpc_fsid_present} += $split[2]; + $data->{stats}{client_rpc_ExchangeId} += $split[3]; + $data->{stats}{client_rpc_CreateSess} += $split[4]; + } elsif ( $previous_line =~ /destroy_session\ +sequence\ +get_lease_time\ +reclaim_comp\ +layoutget/ + && $mode eq 'client' ) + { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_DestroySess} += $split[0]; + $data->{stats}{client_rpc_sequence} += $split[1]; + $data->{stats}{client_rpc_get_lease_time} += $split[2]; + $data->{stats}{client_rpc_ReclaimCompl} += $split[3]; + $data->{stats}{client_rpc_LayoutGet} += $split[4]; + } elsif ( $previous_line =~ /getdevinfo\ +layoutcommit\ +layoutreturn\ +secinfo_no\ +test_stateid/ + && $mode eq 'client' ) + { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_GetDevInfo} += $split[0]; + $data->{stats}{client_rpc_LayoutCommit} += $split[1]; + $data->{stats}{client_rpc_LayoutReturn} += $split[2]; + $data->{stats}{client_rpc_secinfo_no} += $split[3]; + $data->{stats}{client_rpc_test_stateid} += $split[4]; + } elsif ( $previous_line =~ /free_stateid\ +getdevicelist\ +bind_conn_to_ses\ +destroy_clientid\ +seek/ + && $mode eq 'client' ) + { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_FreeStateID} += $split[0]; + $data->{stats}{client_rpc_getdevicelist} += $split[1]; + $data->{stats}{client_rpc_BindConnSess} += $split[2]; + $data->{stats}{client_rpc_DestroyClId} += $split[3]; + $data->{stats}{client_rpc_Seek} += $split[4]; + } elsif ( $previous_line =~ /allocate\ +deallocate\ +layoutstats\ +clone/ && $mode eq 'client' ) { + my @split = split( /[\t\ ]+/, $line ); + $data->{stats}{client_rpc_Allocate} += $split[0]; + $data->{stats}{client_rpc_Deallocate} += $split[1]; + $data->{stats}{client_rpc_layoutstats} += $split[2]; + $data->{stats}{client_rpc_Close} += $split[3]; } $previous_line = $line; } ## end foreach my $line (@output_split)