{"id":5473,"date":"2018-10-14T00:11:53","date_gmt":"2018-10-14T00:11:53","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=5473"},"modified":"2025-02-01T22:39:31","modified_gmt":"2025-02-01T22:39:31","slug":"how-to-monitor-perforce-server-helix-core-server-p4d","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/how-to-monitor-perforce-server-helix-core-server-p4d\/","title":{"rendered":"How to monitor Perforce Server (Helix Core Server &#8211; p4D)"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5506\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/10\/perforce.png\" alt=\"\" width=\"600\" height=\"315\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/10\/perforce.png 600w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/10\/perforce-300x158.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>There are various ways you can monitor Perforce Server (Helix Core Server &#8211; p4D).<\/p>\n<h3>Method 1 &#8211; Monitoring the Perforce Server disk space<\/h3>\n<p>Use the p4 diskspace command to monitor diskspace usage. By default, p4 diskspace displays the amount of free space, diskspace used, and total capacity of any filesystem used by Helix Server.<\/p>\n<p>[code]# Shows summary information about the current availability of disk space on the server<br \/>\n$ p4 diskspace<\/p>\n<p># Report disk space available for filesystem holding the specified depot.<br \/>\n$ p4 diskspace depot<\/p>\n<p># Report disk space available for filesystem holding P4JOURNAL.<br \/>\n$ p4 diskspace P4JOURNAL<\/p>\n<p># Report disk space available for filesystem holding P4LOG (server log).<br \/>\n$ p4 diskspace P4LOG<\/p>\n<p># Report disk space available for filesystem holding P4ROOT.<br \/>\n$ p4 diskspace P4ROOT<\/p>\n<p># To Set the Storage and reserve ten percent of the total disk space for P4ROOT:<br \/>\n$ p4 configure set filesys.P4ROOT.min=10%<\/p>\n<p># To estimate how much disk space is currently occupied by specific files in a depot, use the p4 sizes command<br \/>\n# p4 sizes -a -s -b 512 \/\/depot\/&#8230;[\/code]<\/p>\n<h3>Method 2 &#8211; Monitoring the Perforce Server process<\/h3>\n<p>Use the p4 monitor command to observe and control Helix Server-related processes running on your Helix Server machine<\/p>\n<p>[code]# To monitor active commands, set the monitor configurable to 1:<br \/>\n$ p4 configure set monitor=1<\/p>\n<p>#Valid values for the monitor configurable are:<br \/>\n0: Server process monitoring off. (Default)<br \/>\n1: monitor active commands<br \/>\n2: active commands and idle connections<br \/>\n3: sames as 2, but also includes connections that failed to initialize (stuck at the Init() phase)<br \/>\n5: sames as 2, but also includes a list of the files locked by the command for more than one second<br \/>\n10: same as 5, but also includes lock wait times<br \/>\n25: sames as 10, except that the list of files locked by the command includes files locked for any duration<\/p>\n<p># To monitor the Zoombie Process<br \/>\n$ p4 monitor terminate pid<br \/>\nwhere pid is a process identifier.<\/p>\n<p># How to Enabling idle processes monitoring<br \/>\n$ p4 configure set monitor=2<br \/>\n$ p4 monitor show -s I<\/p>\n<p># To list the processes monitored by Helix Server, use the command:<br \/>\n$ p4 monitor show<br \/>\n$ p4 monitor show -s R<br \/>\n$ p4 monitor show -a<br \/>\n$ p4 monitor show -e<br \/>\n$ p4 monitor show -a -l<\/p>\n<p># Showing information about locked files<br \/>\n$ p4 monitor show -L[\/code]<\/p>\n<h3>Method 3 &#8211; Setting Perforce Server (Helix Core Server) trace and tracking flags<\/h3>\n<p>[code]<br \/>\n# To modify the behavior of command tracing or performance tracking, specify the appropriate -v subsystem=value flag to the p4d startup command. Use P4LOG or the -L logfile flag to specify the log file. For example:<br \/>\n$ p4d -r \/usr\/perforce -v server=2 -p 1666 -L \/usr\/perforce\/logfile<\/p>\n<p># Alternatively, you can use the p4 configure command:<br \/>\n$ p4 configure set server=3[\/code]<\/p>\n<h3>Method 4 &#8211; Auditing user file access<\/h3>\n<p>Auditing is disabled by default, and is only enabled if P4AUDIT is set to point to the location of the audit log file, or if the server is started with the -A auditlog flag.<\/p>\n<p>[code]$ tail -2 auditlog<br \/>\nIf a command is run on the machine that runs the Helix Server, the clientIP is shown as 127.0.0.1.[\/code]<\/p>\n<h3>Method 5 &#8211; P4Nagios: Helix Monitoring for the Enterprise<\/h3>\n<p>If your organization has to manage multiple servers, then you probably already know about or are using an infrastructure monitoring suite such as Nagios.<br \/>\nP4Nagios can alert on:<\/p>\n<p>\u2022 inaccessible P4D service.<br \/>\n\u2022 imminent P4D license expiry.<br \/>\n\u2022 excessive concurrent P4 commands.<br \/>\n\u2022 replication status (when monitoring the replica).<br \/>\n\u2022 lack of available P4D disk space.<\/p>\n<p><strong>Reference<\/strong><\/p>\n<p>https:\/\/www.perforce.com\/perforce\/r15.2\/manuals\/p4sag\/chapter.monitoring.html<br \/>\nhttps:\/\/www.perforce.com\/perforce\/r14.2\/manuals\/cmdref\/p4_monitor.html<br \/>\nftp:\/\/ftp.perforce.com\/pub\/perforce\/r16.2\/doc\/manuals\/p4sag\/chapter.monitoring.html<br \/>\nhttps:\/\/www.perforce.com\/blog\/vcs\/p4nagios-helix-monitoring-enterprise<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are various ways you can monitor Perforce Server (Helix Core Server &#8211; p4D). Method 1 &#8211; Monitoring the Perforce Server disk space Use the p4 diskspace command to monitor diskspace usage. By default, p4 diskspace displays the amount of free space, diskspace used, and total capacity of any filesystem used by Helix Server. [code]#&#8230;<\/p>\n","protected":false},"author":1,"featured_media":5506,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[370],"tags":[5092,5071,435,5096,5095,5097,5093,5094,373,399],"class_list":["post-5473","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-perforce","tag-core","tag-helix","tag-monitor","tag-p4-configure","tag-p4-diskspace","tag-p4-monitor","tag-p4d","tag-p4nagios","tag-perforce","tag-server"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/5473","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=5473"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/5473\/revisions"}],"predecessor-version":[{"id":5507,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/5473\/revisions\/5507"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/5506"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=5473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=5473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=5473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}