@@ -41,23 +41,18 @@ bundle common inventory_linux
4141 if => strcmp("$(proc_routes[$(routeidx)][1])", "00000000");
4242
4343 linux::
44- "nfs_servers" -> { "CFE-3259" }
45- comment => "NFS servers (to list hosts impacted by NFS outages)",
46- slist => maplist( regex_replace( $(this) , ":.*", "", "g"),
47- # NFS server is before the colon (:), that's all we want
48- # e.g., nfs.example.com:/vol/homedir/user1 /home/user1 ...
49- # ^^^^^^^^^^^^^^^
50- grep( ".* nfs .*",
51- readstringlist("/proc/$(this.promiser_pid)/mounts", "", "\n", inf, inf)
52- )
53- ),
54- if => and( fileexists( "/proc/$(this.promiser_pid)/mounts" ),
55- not( isvariable( "$(this.promiser)" ) ) );
56-
57-
58- "nfs_server[$(nfs_servers)]"
59- string => "$(nfs_servers)",
60- meta => { "inventory", "attribute_name=NFS Server" };
44+
45+ "mounts" string => "/proc/$(this.promiser_pid)/mounts";
46+
47+ "nfs_mounts"
48+ slist => grep( ".* nfs .*",
49+ readstringlist("$(mounts)", "", "\n", inf, inf) ),
50+ if => not( isvariable( "$(this.promiser)" ) );
51+
52+ "nfs_server[$(nfs_mounts)]" -> { "CFE-3259", "ENT-13210" }
53+ string => regex_replace( "$(nfs_mounts)", ":.*", "", "g" ),
54+ meta => { "inventory", "attribute_name=NFS Server" },
55+ if => not( isvariable( "$(this.promiser)" ) );
6156
6257
6358 classes:
0 commit comments