The proposed paper deals with a Decision Support System (DSS) conceived for agronomists and farm managers involved in the fertirrigation (FER) process. The DSS has been developed within the Smart District 4.0 (SD 4.0) project, funded with the contribution of the Italian Ministry of Economic Development (MISE), aiming to sustain the digitization process of the Italian Small and Medium Enterprises (SMEs). The DSS is part of an integrated framework, mainly including advanced services for blockchain traceability and agriculture planning, optimizing the cooperation among different actors, such as farmers, agronomists and fertilizer suppliers. The most relevant and challenging part of the platform consists of Machine Learning (ML) supervised and unsupervised algorithms with high performance, to optimize production and quality in viticulture. Specifically, the Probabilistic Neural Network (PNN) model provides the performance about time shortage prediction when compared with other ML algorithm performance. Finally, the clustering k-Means algorithm is applied to extract information about active substances, doses, time of shortage, adversities, and pathogen elements, useful to optimize a FER plan. All the analyzed algorithms are applied to an experimental dataset. The work starts with the design of the processes and of the information flow able to optimize grape supply chain and traceability, and then focuses on data analysis. The data analysis approach is suitable to formulate precision farming rules.